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

Re: [leafnode-list] doing fsync after fetching news

Andrey Ulanov <drey@xxxxxxxxxx> writes:

> Just write one any character to file (without ending cr/lf).
> I tested this with slrn and mutt (patched with nntp). 

I see the problem. It tries to print an "internal error" message, but
does not send the trailing CR/LF after the error message.

This patch should prevent the clients from hanging. Please apply it,
recompile and reinstall leafnode (the patch is against
leafnode-1.9.32.rel) and let me know if helps. It won't fix the
corruption, but the hang -- and kills the broken
article. (leafnode-1.9.33 will also detect errors when unlinking, the
patch below will not. leafnode-1.9.33 has not yet been released.)

Index: nntpd.c
RCS file: /var/CVS/leafnode-1/nntpd.c,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -r1.87 -r1.88
--- nntpd.c	15 Dec 2002 15:56:41 -0000	1.87
+++ nntpd.c	10 Jan 2003 01:01:19 -0000	1.88
@@ -549,7 +549,14 @@
     if (!localmsgid) {
-	printf("503 internal error %s:%lu", __FILE__, (unsigned long)__LINE__);
+	const char *tmp = "423 Corrupt article.";
+	printf("%s\r\n", tmp);
+	if (debugmode)
+	    syslog(LOG_DEBUG, ">%s", tmp);
+	if (replyartno) {
+	    (void)xsnprintf(s, SIZE_s, "%lu", replyartno);
+	    (void)unlink(s);
+	}
 	if (xref)

Matthias Andree
leafnode-1 download: http://sourceforge.net/projects/leafnode/
leafnode-1 docs/new: http://mandree.home.pages.de/leafnode/
leafnode-2 homepage: http://mandree.home.pages.de/leafnode/beta/

leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx -- mailing list for leafnode
To unsubscribe, send mail with "unsubscribe" in the subject to the list