xhdr fix

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

 



Here is a unified diff of changes I made to correctly support XHDR and
extract the information from the cached xover files.

The current implementation of nntpcache requires that a ":" be part of the
header field of the xhdr command.  That is, an xhdr command should be of
the form:

xhdr subject nnnnn

But nntpcache requires that it be:

xhdr subject: nnnnn

Inquiries on the ietf-nntp mailling list resulted in no known servers that
support the ":" in the command.  

So, I made the following change:

------------------------------------------------------------------------
--- xover.c.orig	Wed Jun  4 21:04:49 1997
+++ xover.c	Sat Jun 14 11:10:35 1997
@@ -1147,7 +1147,7 @@
 
 	char msgid[MAX_MSGID] = "";
 	char buf[MAX_LINE];
-	char header[128];
+	char header[129];
 
 	if (sscanf (args, "%*s %127s <%127[^>\r\n]", header, msgid) != 2 &&
 	    (sscanf (args, "%*s %127s %d-%d", header, &min, &max) == 12345678 || min<0 || max < 0 || (max > 0 && min > max)))
@@ -1244,6 +1244,7 @@
 			emitrn (NNTP_DONTHAVEIT);
 		return;
 	}
+	strcat(header,":");
 	if (CurrentScfg->xover_timeout < 1 || !isFieldInXover(header) || !CurrentScfg->overview_fmt)
 	{
 		Cemit (args);
------------------------------------------------------------------------

Currently, isFieldInXover() is only used in this function.  I considered
changing it to accept both with and without the colon, but I wasn't sure
if perhaps that function will be used in the future.  So, I instead changed
what is passed to it.

Also, increased the array a bit, incase there was some reason the header
field has to be at least 127 characters.

mrc
-- 
       Mike Castle       Life is like a clock:  You can work constantly
  dalgoda@ix.netcom.com  and be right all the time, or not work at all
 [Note the 4 line .sig]  and be right at least twice a day.  -- mrc
    We are all of us living in the shadow of Manhattan.  -- Watchmen


[Index of Archives]     [Yosemite]     [Yosemite Campsites]     [Bugtraq]     [Linux]     [Trn]

Powered by Linux