INN commit: trunk (9 files)

INN Commit rra at isc.org
Wed Jan 20 20:52:13 UTC 2010


    Date: Wednesday, January 20, 2010 @ 12:52:12
  Author: iulius
Revision: 8907

See commit [8889].

Change "feedtrash" (inn.conf) to use "Aj" (newsfeeds) so that
we can have a finer configuration of that behaviour, per feed.
Thanks to D. Stussy for the idea.

Modified:
  trunk/doc/pod/active.pod
  trunk/doc/pod/inn.conf.pod
  trunk/doc/pod/newsfeeds.pod
  trunk/include/inn/innconf.h
  trunk/innd/art.c
  trunk/innd/innd.h
  trunk/innd/newsfeeds.c
  trunk/lib/innconf.c
  trunk/samples/inn.conf.in

-----------------------+
 doc/pod/active.pod    |    6 +++---
 doc/pod/inn.conf.pod  |   18 +++---------------
 doc/pod/newsfeeds.pod |   31 +++++++++++++++++++++----------
 include/inn/innconf.h |    1 -
 innd/art.c            |    8 ++++++--
 innd/innd.h           |    1 +
 innd/newsfeeds.c      |    2 ++
 lib/innconf.c         |    1 -
 samples/inn.conf.in   |    1 -
 9 files changed, 36 insertions(+), 33 deletions(-)

Modified: doc/pod/active.pod
===================================================================
--- doc/pod/active.pod	2010-01-17 19:48:14 UTC (rev 8906)
+++ doc/pod/active.pod	2010-01-20 20:52:12 UTC (rev 8907)
@@ -25,9 +25,9 @@
 
 If none of the newsgroups listed in the Newsgroups: header of an article
 are present in this file, the article is either rejected (if I<wanttrash>
-is false in F<inn.conf>), or is filed into the newsgroup C<junk> and, in
-case I<feedtrash> is false, only propagated to sites that receive the C<junk>
-newsgroup (if I<wanttrash> is true).
+is false in F<inn.conf>), or is filed into the newsgroup C<junk> and,
+when C<Aj> is not set in the F<newsfeeds> feed pattern, only propagated
+to sites that receive the C<junk> newsgroup (if I<wanttrash> is true).
 
 Each line of this file consists of four fields separated by a space:
 

Modified: doc/pod/inn.conf.pod
===================================================================
--- doc/pod/inn.conf.pod	2010-01-17 19:48:14 UTC (rev 8906)
+++ doc/pod/inn.conf.pod	2010-01-20 20:52:12 UTC (rev 8907)
@@ -178,18 +178,6 @@
 accepted on the local machine, but articles rejected by the filter will
 I<not> be fed to any peers specified in F<newsfeeds> with the C<Af> flag.
 
-=item I<feedtrash>
-
-Set this to true if you want to feed articles accepted and filed in C<junk>
-(due to I<wanttrash>) to peers based on their F<newsfeeds> feed patterns
-(applied to the Newsgroups: header as though the article were accepted
-and all those groups were locally carried).  This is useful if you want
-to run INN with a minimal F<active> file and propagate all posts.
-
-This is a boolean value and the default is false, that is to say that
-articles are filed in C<junk> and propagated to sites that receive the
-C<junk> newsgroup.
-
 =item I<hiscachesize>
 
 If set to a value other than C<0>, a hash of recently received Message-IDs
@@ -349,9 +337,9 @@
 Set this to true if you want to file articles posted to unknown newsgroups
 (newsgroups not in the F<active> file) into the C<junk> newsgroup rather
 than rejecting them.  This is sometimes useful for a transit news server
-that needs to propagate articles (according to the setting of I<feedtrash>)
-in all newsgroups regardless if they're carried locally.  This is a boolean
-value and the default is false.
+that needs to propagate articles (according to the setting of C<Aj> in
+the F<newsfeeds> feed pattern) in all newsgroups regardless if they're
+carried locally.  This is a boolean value and the default is false.
 
 =item I<wipcheck>
 

Modified: doc/pod/newsfeeds.pod
===================================================================
--- doc/pod/newsfeeds.pod	2010-01-17 19:48:14 UTC (rev 8906)
+++ doc/pod/newsfeeds.pod	2010-01-20 20:52:12 UTC (rev 8907)
@@ -123,11 +123,10 @@
 
 Control messages follow slightly different propagation rules than normal
 articles; see innd(8) for the details.  Note that most subscriptions
-should have C<!junk,!control,!control.*> in their pattern list due to
-those propagation rules (and since C<junk> is a special internal newsgroup;
-see I<feedtrash> and I<wanttrash> in inn.conf(5) for more details on what
-it's used for) and that the best way to keep control messages local to a
-site is with a distribution.
+should have C<!junk,!control,!control.*> in their pattern list due to those
+propagation rules (and since C<junk> is a special internal newsgroup; see
+I<wanttrash> in inn.conf(5) for more details on what it's used for) and that
+the best way to keep control messages local to a site is with a distribution.
 
 A subscription can be further modified by specifying distributions that
 the site should or should not receive.  The default is to send all
@@ -269,7 +268,7 @@
 
 =item d
 
-Only send articles with a Distribution header.  Combined with a particular
+Only send articles with a Distribution: header.  Combined with a particular
 distribution value in the I<distribution> part of the site entry, this can
 be used to limit articles sent to a site to just those with a particuliar
 distribution.
@@ -277,15 +276,27 @@
 =item e
 
 Only send articles where every newsgroup listed in the Newsgroups: header
-exists in the active file.
+exists in the F<active> file.
 
 =item f
 
 Don't send articles rejected by filters.  This is only useful when
-I<dontrejectfiltered> is set in F<inn.conf>.  With that variable set, this
-lets one accept all articles but not propagate filtered ones to some
-sites.
+I<dontrejectfiltered> is set to true in F<inn.conf>.  With that variable
+set, this lets one accept all articles but not propagate filtered ones to
+some sites.
 
+=item j
+
+Propagate articles according to their Newsgroups: header.  This is only
+useful when I<wanttrash> is set to true in F<inn.conf>.  With that variable
+set, articles accepted and filed in C<junk> (due to I<wanttrash>) are fed to
+peers based on their subscription pattern applied to the Newsgroups: header
+as though they were accepted and all those groups were locally carried.
+Otherwise, they are propagated to sites that receive the C<junk> newsgroup.
+
+This variable is useful if you want to run INN with a minimal F<active>
+file and propagate all posts.
+
 =item o
 
 Only send articles for which overview data was stored.

Modified: include/inn/innconf.h
===================================================================
--- include/inn/innconf.h	2010-01-17 19:48:14 UTC (rev 8906)
+++ include/inn/innconf.h	2010-01-20 20:52:12 UTC (rev 8907)
@@ -35,7 +35,6 @@
     char *bindaddress;          /* Which interface IP to bind to */
     char *bindaddress6;         /* Which interface IPv6 to bind to */
     bool dontrejectfiltered;    /* Don't reject filtered article? */
-    bool feedtrash;             /* Feed the junk group as though the groups really existed. */
     unsigned long hiscachesize; /* Size of the history cache in kB */
     bool ignorenewsgroups;      /* Propagate cmsgs by affected group? */
     bool immediatecancel;       /* Immediately cancel timecaf messages? */

Modified: innd/art.c
===================================================================
--- innd/art.c	2010-01-17 19:48:14 UTC (rev 8906)
+++ innd/art.c	2010-01-20 20:52:12 UTC (rev 8907)
@@ -2234,10 +2234,14 @@
          * if it were created. */
         ARTsendthegroup(*groups, ARTctl);
         Accepted = true;
-      } else if (innconf->wanttrash && innconf->feedtrash && !innconf->verifygroups) {
+      } else if (innconf->wanttrash && !innconf->verifygroups) {
         /* Don't set Accepted in this case, because we may still end
          * up filing the article in the junk group. */
-        ARTsendthegroup(*groups, ARTjnk);
+        for (ngp = NGfind(ARTjnk), sp = Sites, i = nSites; --i >= 0; sp++) {
+            if (sp->Name != NULL && sp->FeedTrash && SITEwantsgroup(sp, *groups)) {
+                SITEmark(sp, ngp);
+            }
+        }
         NonExist = true;
       } else {
         NonExist = true;

Modified: innd/innd.h
===================================================================
--- innd/innd.h	2010-01-17 19:48:14 UTC (rev 8906)
+++ innd/innd.h	2010-01-20 20:52:12 UTC (rev 8907)
@@ -486,6 +486,7 @@
   bool		  NeedOverviewCreation;
   bool		  FeedwithoutOriginator;
   bool		  DropFiltered;
+  bool            FeedTrash;
   int		  Hops;
   int		  Groupcount;
   int		  Followcount;

Modified: innd/newsfeeds.c
===================================================================
--- innd/newsfeeds.c	2010-01-17 19:48:14 UTC (rev 8906)
+++ innd/newsfeeds.c	2010-01-20 20:52:12 UTC (rev 8907)
@@ -468,6 +468,7 @@
     sp->NeedOverviewCreation = false;
     sp->FeedwithoutOriginator = false;
     sp->DropFiltered = false;
+    sp->FeedTrash = false;
     sp->HashFeedList = NULL;
 
     /* Nip off the first field, the site name. */
@@ -540,6 +541,7 @@
 		case 'd': sp->DistRequired = true;	break;
 		case 'e': sp->DontWantNonExist = true;	break;
 		case 'f': sp->DropFiltered = true;	break;
+                case 'j': sp->FeedTrash = true;         break;
 		case 'o': sp->NeedOverviewCreation = true;	break;
 		case 'O': sp->FeedwithoutOriginator = true;	break;
 		case 'p': sp->IgnorePath = true;	break;

Modified: lib/innconf.c
===================================================================
--- lib/innconf.c	2010-01-17 19:48:14 UTC (rev 8906)
+++ lib/innconf.c	2010-01-20 20:52:12 UTC (rev 8907)
@@ -158,7 +158,6 @@
     { K(chanretrytime),           UNUMBER  (300) },
     { K(datamovethreshold),       UNUMBER (8192) },
     { K(dontrejectfiltered),      BOOL   (false) },
-    { K(feedtrash),               BOOL   (false) },
     { K(hiscachesize),            UNUMBER  (256) },
     { K(icdsynccount),            UNUMBER   (10) },
     { K(ignorenewsgroups),        BOOL   (false) },

Modified: samples/inn.conf.in
===================================================================
--- samples/inn.conf.in	2010-01-17 19:48:14 UTC (rev 8906)
+++ samples/inn.conf.in	2010-01-20 20:52:12 UTC (rev 8907)
@@ -40,7 +40,6 @@
 #bindaddress:
 #bindaddress6:
 dontrejectfiltered:     false
-feedtrash:              false
 hiscachesize:           256
 ignorenewsgroups:       false
 immediatecancel:        false




More information about the inn-committers mailing list