writing 0xff to *_xover and MAX_LINE

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

 



Hi:

	I've checked the changes between 0.92UL8 and 0.93UL1 and
I don't quite understand the memset used to write 0xff to the _xover
file in xover_input below:

memset (xf->buf+(min%MI)*4, 0xff, (((min%MI+max+1-min)>MI)? MI-(min%MI): max+1-min)*4);

This works if we are only creating one file durnig the transaction.
However, if we were to create two xover files, then the second one
does not start at min%MI, it starts at 0.  This means that there will
be a section that should've been 0xff'ed in the the second file that
will be left as 0x0's.  This probably won't affect much but is certainly
a bug.  The patch appeneded fixes this by checking whether min/MT==t.

Another thing is what should we do about those big crossposts stuffing
up nntpcached because MAX_LINE is only 1025? Has anyone looked at the
source of INN? What does it say that it should do? In the mean time people
reading groups susceptible to massive crossposts probably should increase
MAX_LINE accordingly.  (The problem can manifest itself by writing one xref
record over and over again to the client)

PS Julian, your fix to attachGroup is much nicer, thanks!

PPS Can anybody else look at there active.times & active and tell
me if they contain the same newsgroups? Cause the INN servers around
here keep deleted groups in active.times which confuses nntpcahched.

-- 
Debian GNU/Linux 1.1 is out! { http://www.debian.org/ }
Email:  Herbert Xu ~{PmV>HI~} <herbert@greathan.apana.org.au>
{ http://greathan.apana.org.au/~herbert/ }
PGP Key:  pgp-public-keys@pgp.mit.edu or any other key sites
--
diff -u nntpcache-0.93.1UL.orig/xover.c nntpcache-0.93.1UL/xover.c
--- nntpcache-0.93.1UL.orig/xover.c	Sat Oct  5 14:44:52 1996
+++ nntpcache-0.93.1UL/xover.c	Sun Oct  6 10:02:18 1996
@@ -626,7 +626,26 @@
 		 *      * - will be pulled from the cache
 		 *
 		 */
-		memset (xf->buf+(min%MI)*4, 0xff, (((min%MI+max+1-min)>MI)? MI-(min%MI): max+1-min)*4);
+		if (min / MI == t)
+		{
+			if (min % MI + (max - min) >= MI)
+				memset (xf->buf+((min%MI)*4), 0xff, (MI-(min%MI))*4);
+			else
+				memset (xf->buf+((min%MI)*4), 0xff, (max-min+1)*4);
+		}
+		else
+		{
+			/*
+			* assert(response % MI == 0);
+			* we do assume that here and if it is not
+			* so an error must have occurred.
+			*/
+			if (max - t * MI >= MI)
+				memset(xf->buf, 0xff, MI*4);
+			else
+				memset(xf->buf, 0xff, (max-t*MI+1)*4);
+		}
+
 	} else
 	{
 		if (!xf->locked) /* size can't change if we have locked it */


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

Powered by Linux