]> git.pld-linux.org Git - packages/nagios-plugin-check_rbl.git/commitdiff
- perlcritic taught me not to get fooled by lexical scope in foreach (page 108 of...
authorElan Ruusamäe <glen@pld-linux.org>
Tue, 6 Apr 2010 18:05:33 +0000 (18:05 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    mdns.patch -> 1.3

mdns.patch

index 4c87bae88bccb4f2e850142db09579da1551b781..eb9dcb423784dbc73f5fb96816153d05b74880cc 100644 (file)
@@ -1,5 +1,5 @@
 --- check_rbl-1.2.0/check_rbl  2010-04-06 20:40:42.858468257 +0300
-+++ check_rbl-1.2.0/check_rbl  2010-04-06 20:40:42.858468257 +0300
++++ check_rbl-1.1.0/check_rbl  2010-04-06 21:00:56.970381943 +0300
 @@ -4,6 +4,7 @@
  # See  the INSTALL file for installation instructions
  #
@@ -74,7 +74,7 @@
  # Usage     : verbose("some message string", $optional_verbosity_level);
  # Purpose   : write a message if the verbosity level is high enough
  # Returns   : n/a
-@@ -123,36 +89,119 @@
+@@ -123,36 +89,116 @@
  }
  
  ##############################################################################
 +      my @addrs = @$data;
 +      my %addrs;
 +      while (1) {
-+              my ($name, $sock);
-+
 +              #----------------------------------------------------------------------
 +              # Read names until we've filled our quota of outstanding requests.
 +              #----------------------------------------------------------------------
 +
 +              while (!$eof && $sel->count < $opt_n) {
 +                      print "DEBUG: reading..." if $opt_d;
-+                      $name = shift @addrs;
++                      my $name = shift @addrs;
 +                      unless (defined $name) {
 +                              print "EOF.\n" if $opt_d;
 +                              $eof = 1;
 +                              last;
 +                      }
 +                      print "NAME: $name\n" if $opt_d;
-+                      $sock = $res->bgsend($name);
++                      my $sock = $res->bgsend($name);
 +
 +                      # we store in a hash the query we made, as parsing it back from
 +                      # response gives different ip for ips with multiple hosts
 +
 +                      print "DEBUG: replies received: ", scalar @ready, "\n" if $opt_d;
 +
-+                      foreach $sock (@ready) {
++                      foreach my $sock (@ready) {
 +                              print "DEBUG: handling a reply\n" if $opt_d;
 +                              my $addr = $addrs{$sock};
 +                              delete $addrs{$sock};
 +
 +              if ($timed_out) {
 +                      print "DEBUG: timeout: clearing the outstanding pool.\n" if $opt_d;
-+                      my $sock;
-+                      foreach $sock ($sel->handles) {
++                      foreach my $sock ($sel->handles) {
 +                              my $addr = $addrs{$sock};
 +                              delete $addrs{$sock};
 +                              $sel->remove($sock);
  }
  
  ##############################################################################
-@@ -232,9 +281,16 @@
+@@ -232,9 +278,16 @@
          'critical has to be greater or equal warning' );
  }
  
  }
  
  if ( !$IP ) {
-@@ -259,28 +315,37 @@
+@@ -259,28 +312,37 @@
  
  verbose 'Checking ' . $OPTIONS->host . " ($IP) on $nservers server(s)\n";
  
This page took 0.071992 seconds and 4 git commands to generate.