Subject: A patch to fix an insidious bug
From: HAKNER JEFF <[email-masked]>
To: [email-masked]
Date: Thu, 24 Oct 1996 23:06:15 -0400

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;