Usenet message of 08/21/1997 in news.software.nntp
Date: Thu, 21 Aug 97 15:07:29 -0500
Newsgroups: news.software.nntp
Subject: Bug in INN overchan backlog patches....
From: mibsoft@epix.net (Forrest J. Cavalier III)
Organization: Mib Software

The patch which goes by various "overchan-backlogs"
names originially by Jerry A., has a defect discussed in
an inn-workers message by Richard Michael Todd of Jul 19
with subject: Various fixes for INN 1.6b1.

Only 1.6b2 and later has the necessary buffer reset.

If the reset is necessary (and I think it is as discussed),
then perhaps the overchan backlog patches should be fixed?
Dave?  Jerry?

I suppose James lost track of which patches went in to 1.6,
and didn't notify the keepers of the patches when the bug
fix went by for 1.6b1.  And Richard Michael Todd didn't
realize he was fixing a patch....

INN installations affected...
    1.5.1 with "overchan backlog" patch installed
    1.6b1

INN installations which are not affected....
    1.6b2
    1.6b3

The gory details follow my sig.  This should be adequate
for you to make the correction to whichever version you
are running....

Forrest Cavalier, Mib Software, INN customization and consulting
Commercial support for INN: http://www.mibsoftware.com/innsup.htm



Here is the code as it appears in three versions in my
unified export format.  Clauses are tagged as follows...
    XINN151 for 1.5.1
    XINN151PATCHED for patch with Jerry's patch.
    XINN160B3 for 1.6b3

Somewhere near 263 in 1.5.1/innd/site.c

    if (i < sp->StopWriting)
        WCHANremove(cp);
#mibexp#ifexp XINN160B3  XINN151PATCHED
    if ((sp->StartWriting == 0 || i > sp->StartWriting)
     && !CHANsleeping(cp)) {
        if (sp->Type == FTchannel) {        /* channel feed, try the write */
            int j;
            if (bp->Left == 0)
                return;
            j = write(cp->fd, (POINTER)&bp->Data[bp->Used], (SIZE_T)bp->Left);
            if (j > 0) {
                bp->Left -= j;
                bp->Used += j;
                i = cp->Out.Left;
            }
            if (bp->Left <= 0) {
#mibexp#elseexp
    if ((sp->StartWriting == 0 || i > sp->StartWriting)
     && !CHANsleeping(cp))
        WCHANadd(cp);
#mibexp#endexp 265
#mibexp#ifexp XINN160B3
                /* reset Used, Left on bp, keep channel buffer size from
                   exploding. */
                bp->Used = bp->Left = 0;
#mibexp#elseexp
#mibexp#endexp
#mibexp#ifexp XINN160B3  XINN151PATCHED
                WCHANremove(cp);
            } else
                WCHANadd(cp);
        }
        else
            WCHANadd(cp);
    }
#mibexp#elseexp
#mibexp#endexp
You can find a summary and links related to this topic
as part of the Mib Software Usenet RKT.