INN commit: trunk/frontends (pullnews.in)
INN Commit
rra at isc.org
Wed Nov 17 19:31:53 UTC 2010
Date: Wednesday, November 17, 2010 @ 11:31:53
Author: iulius
Revision: 9150
The "-k n" flag was not working the way it should in pullnews.
The configuration file was not saved after every n articles
(right behaviour) but after every n articles in one newsgroup.
Thanks to Edmund H. Ramm for the bug report.
Modified:
trunk/frontends/pullnews.in
-------------+
pullnews.in | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
Modified: pullnews.in
===================================================================
--- pullnews.in 2010-11-17 19:06:09 UTC (rev 9149)
+++ pullnews.in 2010-11-17 19:31:53 UTC (rev 9150)
@@ -302,14 +302,14 @@
open(FILE, "<$groupFile") || die "can't open group file $groupFile\n";
-my $count = 0;
+my $array_order = 0;
while (<FILE>) {
next if m!^\s*\#! || m!^\s*$!;
if (m!^(\S+)(\s+(\S+)\s+(\S+))?\s*$!) {
$sname = $1;
$servers->{$sname} = {};
- $servers->{$sname}->{_order} = $count++;
+ $servers->{$sname}->{_order} = $array_order++;
$passwd{$sname} = [ $3, $4 ] if defined $3 and $3 ne "";
} elsif (m!^\s+(\S+)\s+(\d+)\s+(\d+)!) {
my ($group,$date,$high) = ($1,$2,$3);
@@ -330,6 +330,7 @@
die "No servers!\n" if ! @servers;
my $localcxn;
+my $art_total_count = 0; # The number of articles transferred during the session.
if ( not $rnews ) {
print LOG "Connecting to downstream host: $localServer " .
@@ -621,6 +622,7 @@
last if defined $maxArts and $count >= $maxArts;
last if defined $opt_f and $count >= $toget;
$count++;
+ $art_total_count++;
sleep $opt_z if defined $opt_z and $count > 1;
# "Optimized mode" -- check if the article is wanted *before* downloading it.
if (defined $opt_O) {
@@ -868,7 +870,7 @@
printf LOG ("\nDEBUGGING $i %s %s\n", $fromServer->code(),
$fromServer->message()) if $debug >= 2;
}
- saveConfig() if $checkPoint and ($count % $checkPoint) == 0;
+ saveConfig() if $checkPoint and ($art_total_count % $checkPoint) == 0;
print LOG "\n" if (!$quiet && (($count % $progressWidth) == 0));
last if defined $opt_S and time >= $^T+$opt_S;
}
More information about the inn-committers
mailing list