[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[leafnode-list] Re: Excessive error handling on "store: no valid newsgroups"



Patric Mueller <bhaak@xxxxxxx> writes:

> Leafnode gets all confused when trying to parse this control message:
> Subject: cmsg newgroup alt.suisse.bal.andree.colon
> Message-ID: <4144.592285156256018.6767578125318.603515625@xxxxxxxxxxxxxx>
>
> The relevant portion of the output of fetchnews looks like this. For
> testing purposes I set the initialfetch value to 10.
>
> news.individual.de: control.newgroup: skipping articles 1-257963
> inclusive (initial limit)
> control.newgroup: considering 10 articles 257964 - 257973, using XOVER
> control.newgroup: XOVER: 10 seen, 0 I have, 0 filtered, 10 to get
> control.newgroup: will fetch 10 articles
> store: no valid newsgroups
> Wrong reply to ARTICLE command: "Booster to reverse rogue rmgroup."
> control.newgroup: 1 articles fetched (to 2), 0 killed
> news.individual.de: cannot parse reply to "GROUP control.rmgroup": "***Verstärkermeldung***  ***Booster***  ***lettre de renforcateur***"
> ERROR: FETCHNEWS MUST REFETCH THE WHOLE ACTIVE FILE NEXT RUN.
> REASON: could not successfully talk to all servers.
>
>
> I guess leafnode bails with "store: no valid newsgroups" because this
> posting doesn't contain control.newgroup in its Newsgroups-line.
>
> I don't know if leafnode should store a message in a newsgroup when
> this newsgroup is missing from the header.
>
> But it shouldn't just bail without consuming the articles body. A
> check with ethereal showed that leafnode tries to parse the body of
> the control message as response to the subsequent ARTICLE and GROUP
> requests.

...

> I've forgotten to mention that I've tested this with the latest
> leafnode version leafnode-2.0.0.alpha20050914a.

Patric,

I see the problem. The return code is "0", and for that reason,
fetchnews forgets to discard the message body and mistakes it as reply
to other commands.

Can you try the attached patch and let me know if it works for you? The
patch should apply nicely on top of both the 20051113a and the 20050914a
versions.  You can safely ignore the "(offset NN lines)" messages.

Thank you for reporting the problem,

-- 
Matthias Andree
Bugfix: When an article (control article for instance) is not stored
because it has no valid groups, properly read and discard message
body. Reported by Patric Mueller.

diff -rN -u old-leafnode-2/fetchnews.c new-leafnode-2/fetchnews.c
--- old-leafnode-2/fetchnews.c	2005-11-15 09:44:13.000000000 +0100
+++ new-leafnode-2/fetchnews.c	2005-11-15 09:44:13.000000000 +0100
@@ -417,6 +417,7 @@
 
     switch (store_stream(nntpin, 1, (filtermode & FM_HEAD ? filtlst : NULL),
 			 -1, delayflg)) {
+    case 2: /* no valid newsgroups */
     case 1: /* killfilter */
     case -2: /* duplicate */
 	groupkilled++;
diff -rN -u old-leafnode-2/store.c new-leafnode-2/store.c
--- old-leafnode-2/store.c	2005-11-15 09:44:13.000000000 +0100
+++ new-leafnode-2/store.c	2005-11-15 09:44:13.000000000 +0100
@@ -77,6 +77,9 @@
 	return "malformatted";
     case 1:
 	return "killed by filter";
+    case 2:
+	/* FIXME: might be other reasons, too */
+	return "no valid newsgroups";
     default:
 	return "unknown";
     }
@@ -93,6 +96,7 @@
  * - -3 if required header missing or duplicate
  * - -4 if short read or data leftover (with maxbytes)
  * -  1 if article killed by filter
+ * -  2 if article dropped by other reason (no valid newsgroups)
  */
 int
 store_stream(FILE * in /** input file */ ,
@@ -407,7 +412,7 @@
 	}
     }
     if (mastr_str(xref)[0] == '\0')
-	BAIL(0, "no valid newsgroups");
+	BAIL(2, "no valid newsgroups");
     if (fputs("Xref: ", tmpstream) == EOF)
 	BAIL(-1, "write error");
     if (fputs(fqdn, tmpstream) == EOF)
-- 
_______________________________________________
leafnode-list mailing list
leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
https://www.dt.e-technik.uni-dortmund.de/mailman/listinfo/leafnode-list
http://leafnode.sourceforge.net/