INN commit: trunk (CONTRIBUTORS doc/pod/news.pod frontends/pullnews.in)

INN Commit rra at isc.org
Sun Oct 24 15:14:51 UTC 2010


    Date: Sunday, October 24, 2010 @ 08:14:51
  Author: iulius
Revision: 9135

* 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:
  trunk/CONTRIBUTORS
  trunk/doc/pod/news.pod
  trunk/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-03 12:02:56 UTC (rev 9134)
+++ CONTRIBUTORS	2010-10-24 15:14:51 UTC (rev 9135)
@@ -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-03 12:02:56 UTC (rev 9134)
+++ doc/pod/news.pod	2010-10-24 15:14:51 UTC (rev 9135)
@@ -172,6 +172,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-03 12:02:56 UTC (rev 9134)
+++ frontends/pullnews.in	2010-10-24 15:14:51 UTC (rev 9135)
@@ -339,6 +339,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 ) {
@@ -385,6 +390,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;
     {{
@@ -420,7 +429,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