inn 2.3.1: fix for "makehistory[13340]: tradspool: can't determine class: @050000000012000001B10000000000000000@: Bad article handle"

Jonathan Kamens jik at kamens.brookline.ma.us
Tue Jun 5 12:27:56 UTC 2001


I recently upgraded to 2.3.1 and switched to using the storage API
while continuing to use a traditional spool.

When I ran makehistory, I got a whole bunch of log messages of the
form "makehistory[13340]: tradspool: can't determine class:
@050000000012000001B10000000000000000@: Bad article handle".

I did a search for this in DejaNews, and I found a lot of discussion
about it but no actual fixes.  Russ even hinted at the actual problem
in one of his postings about it, so I was surpised to find that it
hadn't been fixed yet.

The function tradspool_next in tradspool.c checks to see if an article
is cross-posted with multiple hard links.  If so, it checks to see if
the current path being examined is not the first path on the Xref
line.  If so, it skips the article by setting "art->len" to 0, since
it assumes that it will be indexed when it is encountered in the first
directory listed on the Xref line.

The error log message given above is what happens when SMgetsub can't
determine the article class.  In this case, it can't determine the
article class because the article's length has been set to 0 so it
can't read the Xref header.  But that's the behavior we want, since we
intentionally made the article's length 0, so the error log message is
completely superfluous.

Here's a proposed fix:

--- tradspool.c.orig	Tue Jun  5 08:19:45 2001
+++ tradspool.c	Tue Jun  5 08:21:27 2001
@@ -1039,6 +1039,7 @@
     char *xrefhdr, *ng, *p;
     unsigned int numxrefs;
     STORAGE_SUB	*sub;
+    BOOL other_xref = FALSE;
 
     if (article == NULL) {
 	priv.ngtp = NULL;
@@ -1131,6 +1132,7 @@
 		    if (strcmp(path, linkpath) != 0) {
 			/* this is linked article, skip it */
 			art->len = 0;
+			other_xref = TRUE;
 		    }
 		    DISPOSE(linkpath);
 		}
@@ -1150,8 +1152,10 @@
     if ((sub = SMgetsub(*art)) == NULL || sub->type != TOKEN_TRADSPOOL) {
 	/* maybe storage.conf is modified, after receiving article */
 	token = MakeToken(priv.ngtp->ngname, artnum, 0);
-	syslog(L_ERROR, "tradspool: can't determine class: %s: %s",
-	       TokenToText(token), SMerrorstr);
+	if (! other_xref) {
+	    syslog(L_ERROR, "tradspool: can't determine class: %s: %s",
+		   TokenToText(token), SMerrorstr);
+	}
     } else {
 	token = MakeToken(priv.ngtp->ngname, artnum, sub->class);
     }


More information about the inn-bugs mailing list