pullnews - bugfix, wishlist, new features

Geraint Edwards gedge-lists-inn-workers at yadn.org
Sat Nov 15 12:15:07 UTC 2008


Two issues (and some minor tidy-ups) resolved with the attached patch to pullnews:

- when an article is foreshortened, pullnews warned of an out of bounds subscript
- when an article number is not in group (423), pullnews redundantly retried that article

-- 
Geraint A. Edwards (aka "Gedge")
gedge at yadn.org
-------------- next part --------------
--- code/pullnews-g8	2008-06-08 09:51:52.000000000 +0100
+++ /home/news/bin/pullnews	2008-10-10 00:41:32.000000000 +0100
@@ -537,7 +537,7 @@
     my ($prevRefused, $prevRejected) = ($info{refused}, $info{rejected});
 
     if (!defined($narticles)) { # Group command failed.
-        warn sprintf ("Group command failed: %s %s\n",
+        warn sprintf ("Group command failed for $group: %s %s\n",
                       $fromServer->code(), $fromServer->message());
         return undef;
     }
@@ -613,7 +613,7 @@
 
                     # Unfold this header (with following lines).
                     my $unfolded_art_hdr = $article->[$idx];
-                    for (my $idx_step = $idx+1;  $article->[$idx_step] =~ /^[[:space:]](.+)/; $idx_step++) {
+                    for (my $idx_step = $idx+1;  $idx_step < @$article and $article->[$idx_step] =~ /^[[:space:]](.+)/;  $idx_step++) {
                         # While next line is continuation...
                         my $more_line = $1;
                         chomp $unfolded_art_hdr;
@@ -630,11 +630,11 @@
                         $m_found_hdrs{lc($hdr_m)} = 1;
                         if ($negate_h) {
                             if ($val_un =~ /$val_m/i) {
-                                print LOG "\tDEBUGGING $i\t-- $hdr_un [$1]\n" if $debug >= 2;
+                                print LOG "\tDEBUGGING $i\t-- $hdr_un [$val_un]\n" if $debug >= 2;
                                 $match_all_hdrs = 0;
                             }
                         } elsif (not $val_un =~ /$val_m/i) {
-                            print LOG "\tDEBUGGING $i\t++ $hdr_un [$1]\n" if $debug >= 2;
+                            print LOG "\tDEBUGGING $i\t++ $hdr_un [$val_un]\n" if $debug >= 2;
                             $match_all_hdrs = 0;
                         }
                         last if not $match_all_hdrs;
@@ -793,7 +793,8 @@
 
             $shash->{$group} = [ time, $high = $i ];
         } else {
-            $shash->{$group} = [ time, $high = $i ] if $fromServer->code() == 430;    # no such article, do not retry
+            $shash->{$group} = [ time, $high = $i ] if $fromServer->code() == 430     # no such article, do not retry
+                                                    or $fromServer->code() == 423;
             print LOG "x" unless $quiet;
             printf LOG ("\nDEBUGGING $i %s %s\n", $fromServer->code(),
                         $fromServer->message()) if $debug >= 2;


More information about the inn-workers mailing list