INN commit: branches/2.5 (3 files)

INN Commit rra at isc.org
Sun Oct 24 15:16:03 UTC 2010


    Date: Sunday, October 24, 2010 @ 08:16:02
  Author: iulius
Revision: 9136

* Add authentication to the downstream server.
* Improve documentation (especially the example for the "-m" flag that
  should be quoted for the shell).
* Do not connect to an upstream server when no newsgroups should
  be fetched.
* Do not stop processing newsgroups when an error occur (for instance
  when a newsgroup mentioned in the configuration file has been removed
  from the upstream server).

Thanks to Edmund H. Ramm for the bug reports.

Modified:
  branches/2.5/CONTRIBUTORS
  branches/2.5/doc/pod/news.pod
  branches/2.5/frontends/pullnews.in

-----------------------+
 CONTRIBUTORS          |    3 ++-
 doc/pod/news.pod      |    7 +++++++
 frontends/pullnews.in |   14 +++++++++++++-
 3 files changed, 22 insertions(+), 2 deletions(-)

Modified: CONTRIBUTORS
===================================================================
--- CONTRIBUTORS	2010-10-24 15:14:51 UTC (rev 9135)
+++ CONTRIBUTORS	2010-10-24 15:16:02 UTC (rev 9136)
@@ -272,4 +272,5 @@
 Wolfgang M. Weyand, Berend Reitsma, William Kronert, Petr Novopashenniy,
 Steve Crook, John F. Morse, Tim Woodall, Jonathan Kamens, Kamil Jonca,
 S.P. Zeidler, Nix, Florian Schlichting, Torsten Jerzembeck, Harald Dunkel,
-Lars Magne Ingebrigtsen, Sam Varshavchik, Matthew Vernon, Ian Jackson
+Lars Magne Ingebrigtsen, Sam Varshavchik, Matthew Vernon, Ian Jackson,
+Edmund H. Ramm

Modified: doc/pod/news.pod
===================================================================
--- doc/pod/news.pod	2010-10-24 15:14:51 UTC (rev 9135)
+++ doc/pod/news.pod	2010-10-24 15:16:02 UTC (rev 9136)
@@ -58,6 +58,13 @@
 
 =item *
 
+B<pullnews> no longer stops processing newsgroups when an error occur during
+its run (for instance when a newsgroup mentioned in the configuration file
+is removed from an upstream server).  Besides, it can now use authentication
+when posting to the downstream server.
+
+=item *
+
 It is now possible to run a script at the end of the execution of
 B<innshellvars> scripts.  If a file named F<innshellvars.local>,
 F<innshellvars.pl.local> or F<innshellvars.tcl.local> is present and

Modified: frontends/pullnews.in
===================================================================
--- frontends/pullnews.in	2010-10-24 15:14:51 UTC (rev 9135)
+++ frontends/pullnews.in	2010-10-24 15:16:02 UTC (rev 9136)
@@ -332,6 +332,11 @@
     my %localopts = ("Port" => "$localPort", "Reader" => $reader, %NNTP_Args);
     $localcxn = Net::NNTP->new($localServer, %localopts) ||
         die "Can't connect to server $localServer\n";
+
+    if (exists $passwd{$localServer} && !$localcxn->authinfo(@{$passwd{$localServer}})) {
+        warn sprintf ("failed to authorize: %s %s\n",
+                      $localcxn->code(), $localcxn->message());
+    }
 }
 
 if ( not $quiet and not $quietness ) {
@@ -378,6 +383,10 @@
 
     my $shash = $servers->{$server};
 
+    # No need to connect to the upstream server when there is no newsgroup
+    # to fetch.  (The value 1 is for the "_order" key in the hash.)
+    next if keys(%{$shash}) == 1;
+
     my $connectionAttempts = 0;
     my $upstream;
     {{
@@ -413,7 +422,10 @@
         next if $group eq '_order';
         next if (@groupsToGet && !grep ($_ eq $group, @groupsToGet));
 
-        last if !crossFeedGroup ($upstream,$localcxn,$server,$group,$shash);
+        # crossFeedGroup returns 1 when the newsgroup is successfully
+        # pulled.  No need to check the return value because we do not
+        # want to abort on the first error.
+        crossFeedGroup ($upstream, $localcxn, $server, $group, $shash);
         last if defined $opt_S and time >= $^T+$opt_S;
         sleep $opt_Z if defined $opt_Z;
     }




More information about the inn-committers mailing list