INN commit: branches/2.5/frontends (pullnews.in)
INN Commit
rra at isc.org
Sun Jan 23 10:27:09 UTC 2011
Date: Sunday, January 23, 2011 @ 02:27:08
Author: iulius
Revision: 9164
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:
branches/2.5/frontends/pullnews.in
-------------+
pullnews.in | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
Modified: pullnews.in
===================================================================
--- pullnews.in 2011-01-23 10:26:30 UTC (rev 9163)
+++ pullnews.in 2011-01-23 10:27:08 UTC (rev 9164)
@@ -295,14 +295,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);
@@ -323,6 +323,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 " .
@@ -614,6 +615,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) {
@@ -861,7 +863,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