🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #466

Re: NNTP's IHAVE gets carried away

#466
From: Paul Traina
Date: Tue, 27 Feb 1990 06:22
28 lines
1736 bytes

The problem is that gethistent really does two related but different functions.

Gethistent is called by ihave() to determine if an article has been received
by the system.

Gethistent is called by openartbyid() to actually give the path of the file.

In the ihave() instance, there is no need to actually dig through the file
to find the damn entry.  I've hacked arround this (it's not the best fix,
but it was simple), by adding a second parameter to gethistent, which is
a flag "returnpath".  I then placed the fragment:

	if (!returnpath)
		return "";

after the "if (content.dptr == NULL)" line.  This will return a valid non-NULL
pointer.  Then add a ",1" to the gethistent call in openartbyid() and a ",0"
in the call in ihave().

Simple, cheap, ugly.  It solves the duplicate message problem *and* it gives
you an extra performance boost on servicing ihave()'s in general.

Now of course, the proper way to do it would be to split the routine up into
int artinhistfile() and char *gethistent().

Regards.
Technical Details
Message-ID: <1278@shelby.Stanford.EDU>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp!utzoo!utstat!helios.physics.utoronto.ca!jarvis.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!decwrl!shelby!ack.Stanford.EDU!pst
References: <1990Feb26.192046.15663@iwarp.intel.com>

Show Full Headers
Complete Article Headers
Message-ID: <1278@shelby.Stanford.EDU>
Subject: Re: NNTP's IHAVE gets carried away
Date: Tue, 27 Feb 1990 06:22:31 +0000
From: pst@ack.Stanford.EDU (Paul Traina)
References: <1990Feb26.192046.15663@iwarp.intel.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp!utzoo!utstat!helios.physics.utoronto.ca!jarvis.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!decwrl!shelby!ack.Stanford.EDU!pst
Newsgroups: news.software.nntp,news.software.b
Sender: news@shelby.Stanford.EDU
Followup-To: news.software.nntp
Lines: 27