aboutsummaryrefslogtreecommitdiffstats
path: root/news
diff options
context:
space:
mode:
authorkrion <krion@FreeBSD.org>2004-10-11 20:43:36 +0800
committerkrion <krion@FreeBSD.org>2004-10-11 20:43:36 +0800
commit144360b75104f2d0e01f0c01f7ec862380b9adfb (patch)
treea423335de5bcfb9c7522457ee14881ba12c78cda /news
parent962e6c9bdb2f381e0f7de8a70dda7a26f5b2a47f (diff)
downloadfreebsd-ports-graphics-144360b75104f2d0e01f0c01f7ec862380b9adfb.tar.gz
freebsd-ports-graphics-144360b75104f2d0e01f0c01f7ec862380b9adfb.tar.zst
freebsd-ports-graphics-144360b75104f2d0e01f0c01f7ec862380b9adfb.zip
Fix a bug that could cause the refetch of the multi-MByte active
file from ALL servers when one server was unreachable. PR: ports/72297 Submitted by: maintainer Approved by: portmgr (implicit)
Diffstat (limited to 'news')
-rw-r--r--news/leafnode/Makefile2
-rw-r--r--news/leafnode/files/patch-fetchnews.c55
2 files changed, 56 insertions, 1 deletions
diff --git a/news/leafnode/Makefile b/news/leafnode/Makefile
index bbfaac1f1b6..b7d33d384dc 100644
--- a/news/leafnode/Makefile
+++ b/news/leafnode/Makefile
@@ -7,7 +7,7 @@
PORTNAME= leafnode
PORTVERSION= 1.10.5
-PORTREVISION= 0
+PORTREVISION= 1
CATEGORIES= news
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE_EXTENDED:S/$/:sourceforge/} \
http://osdn.dl.sourceforge.net/sourceforge/${PORTNAME}/:sourceforge \
diff --git a/news/leafnode/files/patch-fetchnews.c b/news/leafnode/files/patch-fetchnews.c
new file mode 100644
index 00000000000..1200aca9650
--- /dev/null
+++ b/news/leafnode/files/patch-fetchnews.c
@@ -0,0 +1,55 @@
+--- fetchnews.c Fri Sep 3 01:39:44 2004
++++ fetchnews.c.new Fri Sep 3 01:37:56 2004
+@@ -2225,6 +2225,7 @@
+ volatile int rc = 0, skip_servers = 0;
+ volatile int anypost = 0, waitchild = 0, quiet;
+ struct server *current_server;
++ volatile int need_refetch = 0;
+
+ int option, reply;
+ pid_t pid;
+@@ -2380,8 +2381,10 @@
+ nntpquit();
+ if (!rc)
+ rc = 2;
+- if (forceactive)
++ if (forceactive) {
+ error_refetch("caught signal that caused a premature abort.");
++ need_refetch = 1;
++ }
+ skip_servers = 1; /* in this case, jump the while ... loop */
+ } else {
+ canjump = 1;
+@@ -2458,8 +2461,10 @@
+ /* get list of newsgroups or new newsgroups */
+ if (current_server->updateactive) {
+ if (nntpactive(current_server, &stamp)) {
+- if (forceactive)
++ if (forceactive) {
+ error_refetch("obtaining the active file failed.");
++ need_refetch = 1;
++ }
+ rc = 1;
+ }
+ } else {
+@@ -2477,8 +2482,10 @@
+ } else { /* reply = nntpconnect */
+ if (verbose)
+ printf("%s: connection failed.\n", current_server->name);
+- if (forceactive)
++ if (forceactive && current_server->updateactive) {
+ error_refetch("fetching the active list from a server failed.");
++ need_refetch = 1;
++ }
+ rc = 2;
+ }
+ if (!usesupplement)
+@@ -2545,7 +2552,7 @@
+ rc = 1;
+ }
+ } else {
+- if (rc == 0 && updateactive())
++ if (need_refetch == 0 && updateactive())
+ if (killactiveread()) {
+ error_refetch("cannot update active.read file.");
+ rc = 1;