Return-Path: hak@cooper.edu
Received: from magnum.cooper.edu (magnum.cooper.edu [199.98.16.4]) by math.psu.edu (8.7.5/8.7.3) with SMTP id XAA14438 for <barr@math.psu.edu>; Thu, 24 Oct 1996 23:04:50 -0400 (EDT)
Received: by magnum.cooper.edu with UUCP id AA12113
  (5.65c/IDA-1.4.4 for barr@math.psu.edu); Thu, 24 Oct 1996 23:06:15 -0400
Date: Thu, 24 Oct 1996 23:06:15 -0400
From: HAKNER JEFF <hak@cooper.edu>
Message-Id: <199610250306.AA12113@magnum.cooper.edu>
To: barr@math.psu.edu
Subject: A patch to fix an insidious bug

David-
	We had a condition where one of our feeds was getting stuck
on particular articles.  After much head scratching, I found the bug
in nc.c.....it causes the terminating dot to be missed on articles that
are between LargestArticle and LargestArticle+8192 bytes long, therefore
both ends of the connection time out.  Here is a patch:

-Jeff Hakner


# cat nc.patch
*** innd/nc.c.orig      Tue Feb 27 14:13:37 1996
--- innd/nc.c   Thu Oct 24 22:26:37 1996
***************
*** 977,983 ****
                    for (p = bp->Data, i = 0; i < SAVE_AMT; p++, i++)
                        p[0] = p[bp->Used - SAVE_AMT];
                    wp->Size += bp->Used - SAVE_AMT;
!                   bp->Used = SAVE_AMT;
                    cp->State = CSeatarticle;
                }
                cp->Rest = 0;
--- 977,988 ----
                    for (p = bp->Data, i = 0; i < SAVE_AMT; p++, i++)
                        p[0] = p[bp->Used - SAVE_AMT];
                    wp->Size += bp->Used - SAVE_AMT;
! /* CUCC 24OCT1996 JHak...the following line is wrong, we need to reset    */
! /* Lastch here otherwise code below in the CSeatarticle will read garbage */
! /* and will miss the terminator unless the article is big enough (another */
! /* 8192 bytes more) to trip the compaction routine down there             */
!                   /*bp->Used = SAVE_AMT;*/
!                   bp->Used = cp->Lastch = SAVE_AMT;
                    cp->State = CSeatarticle;
                }
                cp->Rest = 0;

