[leafnode-list] using leafnode2 with post-only servers

Matthias Andree ma at dt.e-technik.uni-dortmund.de
Sun Aug 15 23:39:46 CEST 2004


"Cory C. Albrecht" <cory+leafnode at fenris.cjb.net> writes:

>> Does something similar to this work in /etc/leafnode/config?
>> 
>> ## Use this server only for posting:
>> server           = post.only.example.com
>> # prevent active file download:
>> noactive         = 1
>> # only download from groups without name -- as there are no groups
>> # without name, this means "don't fetch any groups":
>> only_groups_pcre = ^$
>> # override only_groups_pcre for posting:
>> post_anygroup    = 1
>
> No good. Still tried to read from that server.

Ugh. This patch is a forward-port of leafnode-1's noread, let me know if
it works for you (please use the latest version from
http://home.pages.de/~mandree/leafnode/beta/ as the basis) - save this
mail to /tmp/noread.patch, unpack the leafnode source, run

patch -p0 </tmp/noread.patch

then compile and install as usual. Let me know if this works or if you
have concerns.

Index: config.example
===================================================================
RCS file: /var/CVS/leafnode-2/config.example,v
retrieving revision 1.28
diff -u -U2 -r1.28 config.example
--- config.example	20 Mar 2004 02:16:13 -0000	1.28
+++ config.example	15 Aug 2004 21:32:09 -0000
@@ -194,4 +194,10 @@
 # noactive = 1
 
+## And this is a news server you only want to post to, but never
+## fetch messages from. If set, noactive = 1 is also assumed.
+## The default is: noread = 0
+# server = post-only.example.com
+# noread = 1
+
 ## Here we have another news server which has a very slow connection. For
 ## that reason, we wait a full minute before we give up trying to connect.
Index: config.table
===================================================================
RCS file: /var/CVS/leafnode-2/config.table,v
retrieving revision 1.20
diff -u -U2 -r1.20 config.table
--- config.table	29 Jan 2004 11:09:36 -0000	1.20
+++ config.table	15 Aug 2004 21:23:02 -0000
@@ -25,4 +25,5 @@
 noactive,CP_NOACTIVE,CS_SERVER
 nodesc,CP_NODESC,CS_SERVER
+noread,CP_NOREAD,CS_SERVER
 only_fetch_once,CP_FETCHONCE,CS_GLOBAL
 only_groups_pcre,CP_ONLYGROUPSPCRE,CS_SERVER
Index: configutil.c
===================================================================
RCS file: /var/CVS/leafnode-2/configutil.c,v
retrieving revision 1.47
diff -u -U2 -r1.47 configutil.c
--- configutil.c	28 Feb 2004 16:33:21 -0000	1.47
+++ configutil.c	15 Aug 2004 21:25:09 -0000
@@ -415,4 +415,11 @@
 				   p->name);
 		    break;
+		case CP_NOREAD:
+		    p->noread = TRUE;
+		    if (debugmode & DEBUG_CONFIG)
+			ln_log_sys(LNLOG_SDEBUG, LNLOG_CTOP,
+				   "config: not fetching articles from %s",
+				   p->name);
+		    break;
 		case CP_INITIAL:
 		    initiallimit = strtoul(value, NULL, 10);
@@ -536,4 +543,5 @@
     p->descriptions = TRUE;
     p->noactive = FALSE;
+    p->noread = FALSE;
     p->next = NULL;
     p->timeout = 30;	/* default 30 seconds */
Index: fetchnews.c
===================================================================
RCS file: /var/CVS/leafnode-2/fetchnews.c,v
retrieving revision 1.152
diff -u -U2 -r1.152 fetchnews.c
--- fetchnews.c	6 Jul 2004 08:57:59 -0000	1.152
+++ fetchnews.c	15 Aug 2004 21:28:09 -0000
@@ -1868,5 +1868,6 @@
 
     /* do regular fetching of articles, headers, delayed bodies */
-    if (action_method & (FETCH_ARTICLE|FETCH_HEADER|FETCH_BODY)) {
+    if (action_method & (FETCH_ARTICLE|FETCH_HEADER|FETCH_BODY)
+	    && !cursrv->noread) {
 	res = processupstream(cursrv, cursrv->name,
 		cursrv->port, forceactive);
Index: leafnode.8.in
===================================================================
RCS file: /var/CVS/leafnode-2/leafnode.8.in,v
retrieving revision 1.23
diff -u -U2 -r1.23 leafnode.8.in
--- leafnode.8.in	13 Aug 2004 15:56:52 -0000	1.23
+++ leafnode.8.in	15 Aug 2004 21:33:01 -0000
@@ -210,4 +210,9 @@
 after the "server" line.
 .TP
+noread = 1
+Prevent fetching news articles or active files from this server. You can
+use this if the upstream is good to post, but too slow to fetch news
+from.
+.TP
 port = 8000
 By default, leafnode tries to connect to its upstream news servers on the
Index: leafnode.h
===================================================================
RCS file: /var/CVS/leafnode-2/leafnode.h,v
retrieving revision 1.101
diff -u -U2 -r1.101 leafnode.h
--- leafnode.h	6 Jul 2004 08:57:30 -0000	1.101
+++ leafnode.h	15 Aug 2004 21:25:05 -0000
@@ -447,4 +447,5 @@
     int descriptions;	/* download descriptions as well */
     int noactive;		/* if true, do not request group lists */
+    int noread;			/* if true, do not request articles */
     int timeout;		/* timeout in seconds before we give up */
     int post_anygroup;


-- 
Matthias Andree

NOTE YOU WILL NOT RECEIVE MY MAIL IF YOU'RE USING SPF!
Encrypted mail welcome: my GnuPG key ID is 0x052E7D95 (PGP/MIME preferred)



More information about the leafnode-list mailing list