cvs commit: qpsmtpd qpsmtpd-forkserver

[email protected] (Robert Spier)
Newsgroups perl.cvs.qpsmtpd
Message-ID <[email protected]>
cvsuser     04/08/09 08:40:56

  Modified:    .        qpsmtpd-forkserver
  Log:
  slight cleanup
  
  Revision  Changes    Path
  1.10      +7 -8      qpsmtpd/qpsmtpd-forkserver
  
  Index: qpsmtpd-forkserver
  ===================================================================
  RCS file: /cvs/public/qpsmtpd/qpsmtpd-forkserver,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -w -r1.9 -r1.10
  --- qpsmtpd-forkserver	9 Aug 2004 08:13:26 -0000	1.9
  +++ qpsmtpd-forkserver	9 Aug 2004 15:40:56 -0000	1.10
  @@ -113,17 +113,16 @@
       }
       my ($port, $iaddr) = sockaddr_in($hisaddr);
       if ($MAXCONNIP) {
  -        my $num_conn = 0;
  -        # If we for-loop directly over values %childstatus, a SIGCHLD can call
  -        # REAPER and slip $rip out from under us.  Causes "Use of freed value in
  -        # iteration" under perl 5.8.4.
  +        my $num_conn = 1; # seed with current value
  +
  +        # If we for-loop directly over values %childstatus, a SIGCHLD
  +        # can call REAPER and slip $rip out from under us.  Causes
  +        # "Use of freed value in iteration" under perl 5.8.4.
           my @rip = values %childstatus;
           foreach my $rip (@rip) {
  -            if ($rip eq $iaddr) {
  -                ++$num_conn;
  -            }
  +          ++$num_conn if (defined $rip && $rip eq $iaddr) {
           }
  -        ++$num_conn; # count this connection, too :)
  +
           if ($num_conn > $MAXCONNIP) {
               my $rem_ip = inet_ntoa($iaddr);
               ::log(LOGINFO,"Too many connections from $rem_ip: "
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.