Difference for utils/metaserver.pl.in from version 1.2 to 1.3


version 1.2 version 1.3
Line 1
 
Line 1
 #!@PERL@  #!/usr/bin/perl
 # $Id: metaserver.pl.in,v 1.2 2005/04/14 06:49:35 mwedel Exp $  # $Id: metaserver.pl.in,v 1.3 2005/07/08 23:48:59 mwedel Exp $
   
 # Copyright 2000 by Mark Wedel.  # Copyright 2000 by Mark Wedel.
 # This script follows the same license as crossfire (GPL).  # This script follows the same license as crossfire (GPL).
Line 27
 
Line 27
 # UPDATE_SYNC determines how often we update the HTML_FILE and CACHE_FILE.  # UPDATE_SYNC determines how often we update the HTML_FILE and CACHE_FILE.
 $UPDATE_SYNC=300;  $UPDATE_SYNC=300;
   
   # IP_INTERVAL is how often (in seconds) same IP can request metaserver
   # info.  This is to prevent DOS attacks.
   
   $IP_INTERVAL=5;
   
 # For gathering some anonymous statistics. You probably want to use  # For gathering some anonymous statistics. You probably want to use
 # MRTG/RRDTOOL for generating statistics from the file.  # MRTG/RRDTOOL for generating statistics from the file.
 # -- Heikki Hokkanen, 2005-03-26  # -- Heikki Hokkanen, 2005-03-26
Line 90
 
Line 95
      # ourselves up to someone intentionally designing something       # ourselves up to someone intentionally designing something
      # that causes these to block, and then have us fork a huge       # that causes these to block, and then have us fork a huge
      # number of process potentially filling up our proc table.       # number of process potentially filling up our proc table.
      if (accept NEWSOCKET, SOCKET1) {       if ($ipaddr=accept NEWSOCKET, SOCKET1) {
    ($port, $ip ) = sockaddr_in( $ipaddr );
    $dq = join('.',unpack('C4', $ip));
    if ($ip_times{$dq} > time) {
        close(NEWSOCKET);
    } else {
        $ip_times{$dq} = time + $IP_INTERVAL;
  foreach $i (keys %data) {   foreach $i (keys %data) {
      # Report idle time to client, and not last update       # Report idle time to client, and not last update
      # as we received in seconds since epoch.       # as we received in seconds since epoch.
Line 103
 
Line 114
      }       }
  }   }
     }      }
       }
   
     # Need to generate some files.  This is also where we remove outdated      # Need to generate some files.  This is also where we remove outdated
     # hosts.      # hosts.


Legend:
line(s) removed in v.1.2 
line(s) changed
 line(s) added in v.1.3

File made using version 1.98 of cvs2html by leaf at 2011-07-21 17:03