[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [leafnode-list] noread patch (Reading and posting to different
<x-flowed>
Matthias Andree wrote:
> Dmitry Samersoff <dsamersoff@xxxxxxxxx> writes:
> Ah, there we get charging the problem. There is no "noread" option.
>
> Try this:
>
> server = fast.example.com # does not let you post
> nopost = 1
>
> server = slow.example.com # lets you post
> # nopost = 0 need not be configured explicitly
>
> This should fetch anything from fast.example.com first, and then the
> missing articles from slow.example.com. It will always try to post to
> slow.example.com. (The order of server= lines in the file is the same as
> the order of contacting the servers.)
Yes! I would like to forbid leafnode to fetch missing aritcles from slow
server in any case, just wait when the same articles appear on fast one.
So I make a very limited number of changes to support noread config
options.
--
Dmitry Samersoff
Technical director, http://www.assist.ru
dsamersoff@xxxxxxxxx, Tel: +7(812)4381000
* There will come soft rains ...
</x-flowed>
diff -u leafnode-1.9.32.rel_orig/config.example leafnode-1.9.32.rel/config.example
--- leafnode-1.9.32.rel_orig/config.example Mon Jan 13 14:33:51 2003
+++ leafnode-1.9.32.rel/config.example Mon Jan 13 14:54:51 2003
@@ -83,6 +83,12 @@
# server = lurk-only.example.com
# nopost = 1
+## And this is a news server you only want to post to, but never
+## fetch messages from.
+## The default is: noread = 0
+# server = post-only.example.com
+# noread = 1
+
## This shows how a server is configured that only has specific news
## groups. Note that this parameter is a PCRE, not a wildmat! See
## pcre(3) or pcre(7), depending on your PCRE version.
diff -u leafnode-1.9.32.rel_orig/configutil.c leafnode-1.9.32.rel/configutil.c
--- leafnode-1.9.32.rel_orig/configutil.c Mon Jan 13 14:33:48 2003
+++ leafnode-1.9.32.rel/configutil.c Mon Jan 13 14:43:28 2003
@@ -374,6 +374,14 @@
p->name, p->nopost);
} else
syslog(LOG_ERR, "config: no server for nopost = %s", value);
+ } else if (strcmp("noread", param) == 0) {
+ if (p) {
+ p->noread = atoi(value);
+ if (debugmode)
+ syslog(LOG_DEBUG, "config: noread for %s is %d",
+ p->name, p->noread);
+ } else
+ syslog(LOG_ERR, "config: no server for noread = %s", value);
} else if (strcmp("initialfetch", param) == 0) {
initiallimit = strtoul(value, NULL, 10);
if (debugmode)
@@ -393,6 +401,7 @@
p->username = NULL;
p->password = NULL;
p->nopost = 0;
+ p->noread = 0;
p->updateactive = TRUE;
p->group_pcre = NULL;
if (servers == NULL)
Common subdirectories: leafnode-1.9.32.rel_orig/doc_german and leafnode-1.9.32.rel/doc_german
diff -u leafnode-1.9.32.rel_orig/fetchnews.c leafnode-1.9.32.rel/fetchnews.c
--- leafnode-1.9.32.rel_orig/fetchnews.c Mon Jan 13 14:33:51 2003
+++ leafnode-1.9.32.rel/fetchnews.c Mon Jan 13 14:47:10 2003
@@ -2008,7 +2008,7 @@
printf("nopost-set ");
printf("\n");
}
- if (!postonly) {
+ if (!postonly && !current_server->noread) {
/* get list of newsgroups or new newsgroups */
if (forceactive || current_server->updateactive) {
if (nntpactive(lastrun)) rc = 1;
diff -u leafnode-1.9.32.rel_orig/leafnode.8.in leafnode-1.9.32.rel/leafnode.8.in
--- leafnode-1.9.32.rel_orig/leafnode.8.in Mon Jan 13 14:33:53 2003
+++ leafnode-1.9.32.rel/leafnode.8.in Mon Jan 13 14:56:29 2003
@@ -403,6 +403,10 @@
Prevent posting to this server. You can use this if the upstream won't let you
post but still greet leafnode with 200.
.TP
+noread = 1
+Prevent fetching news from this server. You can use this if the upstream is good to post,
+but too slow to fetch news from
+.TP
only_groups_pcre = PCRE
This parameter lists the Perl-compatible regular expression of groups
that are fetched or posted to this server. The PCRE is automatically
diff -u leafnode-1.9.32.rel_orig/leafnode.h leafnode-1.9.32.rel/leafnode.h
--- leafnode-1.9.32.rel_orig/leafnode.h Mon Jan 13 14:33:49 2003
+++ leafnode-1.9.32.rel/leafnode.h Mon Jan 13 14:38:42 2003
@@ -214,7 +214,8 @@
int descriptions; /* download descriptions as well */
int timeout; /* timeout in seconds before we give up */
int nopost; /* if set, do not try to post to this server */
- int updateactive; /* update the active file of this server */
+ int noread; /* if set, do not try to fetch articles from this server */
+ int updateactive; /* update the active file of this server */
};
extern int stat_is_evil; /* use HEAD instead of STAT to figure if a
Common subdirectories: leafnode-1.9.32.rel_orig/pcre and leafnode-1.9.32.rel/pcre
Common subdirectories: leafnode-1.9.32.rel_orig/t and leafnode-1.9.32.rel/t
Common subdirectories: leafnode-1.9.32.rel_orig/tools and leafnode-1.9.32.rel/tools