spamassassin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmarti...@apache.org
Subject svn commit: r1073754 - in /spamassassin/trunk/lib/Mail/SpamAssassin: DnsResolver.pm Logger.pm Plugin/AskDNS.pm
Date Wed, 23 Feb 2011 14:25:35 GMT
Author: mmartinec
Date: Wed Feb 23 14:25:35 2011
New Revision: 1073754

URL: http://svn.apache.org/viewvc?rev=1073754&view=rev
Log:
Three minor edits:
- DnsResolver.pm: improved reporting on select failures;
- Logger.pm: replaced a gross hack with a smaller one in $SIG{__DIE__};
- Plugin/AskDNS.pm: modifiers a,d,l,u in suffix form were added with perl 5.13.10

Modified:
    spamassassin/trunk/lib/Mail/SpamAssassin/DnsResolver.pm
    spamassassin/trunk/lib/Mail/SpamAssassin/Logger.pm
    spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/AskDNS.pm

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/DnsResolver.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/DnsResolver.pm?rev=1073754&r1=1073753&r2=1073754&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/DnsResolver.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/DnsResolver.pm Wed Feb 23 14:25:35 2011
@@ -617,10 +617,16 @@ sub poll_responses {
     { my $timer;  # collects timestamp when variable goes out of scope
       if (!defined($timeout) || $timeout > 0)
         { $timer = $self->{main}->time_method("poll_dns_idle") }
+      $! = 0;
       ($nfound, $timeleft) = select($rout=$rin, undef, undef, $timeout);
     }
     if (!defined $nfound || $nfound < 0) {
-      warn "dns: select failed: $!";
+      if ($!) { warn "dns: select failed: $!\n" }
+      else    { warn "dns: select interrupted\n" }
+      return;
+    } elsif (!$nfound) {
+      if (!defined $timeout) { warn("dns: select returned empty-handed\n") }
+      elsif ($timeout > 0) { dbg("dns: select timed out %.3f s", $timeout) }
       return;
     }
 

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Logger.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/Logger.pm?rev=1073754&r1=1073753&r2=1073754&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Logger.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Logger.pm Wed Feb 23 14:25:35 2011
@@ -28,7 +28,7 @@ Mail::SpamAssassin::Logger - SpamAssassi
   };
 
   $SIG{__DIE__} = sub {
-    log_message("error", $_[0]) if $_[0] !~ /\bin eval\b/;
+    log_message("error", $_[0])  if !$^S;
   };
 
 =cut

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/AskDNS.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/AskDNS.pm?rev=1073754&r1=1073753&r2=1073754&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/AskDNS.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/AskDNS.pm Wed Feb 23 14:25:35 2011
@@ -234,17 +234,18 @@ sub parse_and_canonicalize_subtest {
   my $result;
 
   local($1,$2,$3);
-  if (     $subtest =~ m{^ / (.+) / ([msixo]*) \z}xs) {
+  # modifiers /a, /d, /l, /u in suffix form were added with perl 5.13.10
+  if (     $subtest =~ m{^ / (.+) / ([msixoadlu]*) \z}xs) {
     $result = $2 ne '' ? qr{(?$2)$1} : qr{$1};
-  } elsif ($subtest =~ m{^ m \s* \( (.+) \) ([msixo]*) \z}xs) {
+  } elsif ($subtest =~ m{^ m \s* \( (.+) \) ([msixoadlu]*) \z}xs) {
     $result = $2 ne '' ? qr{(?$2)$1} : qr{$1};
-  } elsif ($subtest =~ m{^ m \s* \[ (.+) \] ([msixo]*) \z}xs) {
+  } elsif ($subtest =~ m{^ m \s* \[ (.+) \] ([msixoadlu]*) \z}xs) {
     $result = $2 ne '' ? qr{(?$2)$1} : qr{$1};
-  } elsif ($subtest =~ m{^ m \s* \{ (.+) \} ([msixo]*) \z}xs) {
+  } elsif ($subtest =~ m{^ m \s* \{ (.+) \} ([msixoadlu]*) \z}xs) {
     $result = $2 ne '' ? qr{(?$2)$1} : qr{$1};
-  } elsif ($subtest =~ m{^ m \s*  < (.+)  > ([msixo]*) \z}xs) {
+  } elsif ($subtest =~ m{^ m \s*  < (.+)  > ([msixoadlu]*) \z}xs) {
     $result = $2 ne '' ? qr{(?$2)$1} : qr{$1};
-  } elsif ($subtest =~ m{^ m \s* (\S) (.+) \1 ([msixo]*) \z}xs) {
+  } elsif ($subtest =~ m{^ m \s* (\S) (.+) \1 ([msixoadlu]*) \z}xs) {
     $result = $2 ne '' ? qr{(?$2)$1} : qr{$1};
   } elsif ($subtest =~ m{^ (["']) (.*) \1 \z}xs) {  # quoted string
     $result = $2;



Mime
View raw message