🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #1632

Fix to nn-6.4.18 for NNTP

#1632
From: Marc Kraker Newman
Date: Mon, 07 Dec 1992 03:10
54 lines
2452 bytes
After installing 6.4.18, I found that it was behaving in a mysterious manner.
Whenever I would get to a new group, it would pause for a LONG time, and then
finally would come back.

In my investigation, I found what had happened was that on my old 6.4.0 version,I had the GROUPS file processing totally off.  I had turned it on in the new
config.h file, and whenever I was going to a new group, it would try to get a
copy of the GROUPS file from NNTP.  The file is 60k or so right now, and that
was taking about 5 minutes.

I found the fix in the file answer.c, in the routine open_purpose_file.  It had
a number of bugs, including pointing to the wrong place to get the GROUPS file
after it had been downloaded from NNTP!  Anyway, here is my 'fixed' routine,
use it at your own risk, but feel free to incorporate it in the next release,
just give me credit for the fix.

------------------------------------------------
/*
 *      open_purpose_file()
 *
 *      Open "newsgroups" file once - just rewind() otherwise.
 *      Caller must NOT close it!
 */

FILE *open_purpose_file()
{
    static FILE *f = NULL;
    static int is_open = 0;

    if (is_open) {
        rewind(f);
        return f;
    }
    is_open = 1;
    f = open_file(relative(news_lib_directory, "newsgroups"), OPEN_READ);

#ifdef NNTP
    if ((use_nntp) && (f == NULL)) {
        extern FILE *nntp_get_newsgroups();
        f = nntp_get_newsgroups();
    } else
#endif
    return f;
}
-----------------------------------------------------------------

BTW, this works fine now, and should still work fine if you have a local nn
setup as well.


-- 
Marc K. Newman (N5SLG)			Is UNIX pronounced 
mknewman@blkbox.com 			"UNIQUES" or
PO BOX 591822				"EUNICHS"?
Houston, Texas 77259-1822
Technical Details
Message-ID: <1992Dec07.031057.24940@blkbox>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.nn.mbox.zip!sparky!uunet!psinntp!blkbox!mknewman

Show Full Headers
Complete Article Headers
Message-ID: <1992Dec07.031057.24940@blkbox>
Subject: Fix to nn-6.4.18 for NNTP
Date: Mon, 07 Dec 1992 03:10:57 GMT
From: mknewman@blkbox (Marc Kraker Newman)
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.nn.mbox.zip!sparky!uunet!psinntp!blkbox!mknewman
Newsgroups: news.software.nn,news.software.nntp
Organization: The Black Box, PO Box 591822 Houston, TX 77259-1822
Summary: Fix to SLOW nntp in 6.4.18
Keywords: nntp, nn, unix, news
Lines: 54