🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #1066

Re: C News vs nntpxmit in nntp 1.5.11

#1066
From: Edwin Kremer
Date: Tue, 19 Mar 1991 15:50
50 lines
2599 bytes
In <27E4746A.43C3@ibma0.cs.uiuc.edu> hull@ibma0.cs.uiuc.edu (David Hull) writes:

   | I recently installed the latest patches to nntp and found that the latest
   | version of nntpxmit expects the queue file to contain both the filename
   | and the message-id of the article to be sent.
This is definitely NOT true. I've been running Cnews (15-Dec-90) and
NNTP-1.5.11 for about a month now (after converting from B 2.11.19)
with the 'F' flag. No problem at all.
Yesterday, the manager of a downstream site discovered the 'n' flag and
informed me, so I'm using the 'n' now. (Thanks Henk!)

   | What would be really nice is a
   | nntpxmit which would read the article for the message-id only if it
   | wasn't in the queue file.
It does, although I agree that the code is somewhat sloppy...
Here are some code lines of "nntpxmit.c":

	while ((msgid = getline(Qfp, Article, sizeof(Article))) != NULL) {
		if (!sendarticle(host, Article, msgid)) {
			...
		}
	}

Well, 'getline()' return NULL in case of EOF and  a pointer to "\0" in
case of no Message-Id.
So, if the queue file contains no Message-Id, msgid will be assigned the
value "\0" i.e. *msgid == '\0' which is NOT EQUAL to ``(char *) 0''.

	sendarticle(host, file, msgid)
	{
		if (msgid == NULL || *msgid == '\0') {
			if ((msgid = getmsgid(file, &fp)) == NULL) {
			....
			}
		}
	}

You see that sendarticle() tries to get the Message-Id from the article
file itself in case msgid points to the string "\0". I agree that the
test 'msgid == NULL' is lousy: if msgid really is NULL, it would have
never reached this statement.

			hope this helps,
						--[ Edwin ]--
-- 
Edwin Kremer (SysAdm), Dept. of Computer Science, Utrecht University
Padualaan 14,   P.O. Box 80.089,  3508 TB  Utrecht,  The Netherlands
Telephone: +31-30-534104  | UUCP: ...!uunet!mcsun!hp4nl!ruuinf!edwin
Telefax  : +31-30-513791  | Email: edwin@cs.ruu.nl    [131.211.80.5]
Technical Details
Message-ID: <1991Mar19.155002.28623@cs.ruu.nl>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!uunet!mcsun!hp4nl!alchemy!edwin
References: <27E4746A.43C3@ibma0.cs.uiuc.edu>

Show Full Headers
Complete Article Headers
Message-ID: <1991Mar19.155002.28623@cs.ruu.nl>
Subject: Re: C News vs nntpxmit in nntp 1.5.11
Date: Tue, 19 Mar 1991 15:50:02 +0000
From: edwin@cs.ruu.nl (Edwin Kremer)
References: <27E4746A.43C3@ibma0.cs.uiuc.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!uunet!mcsun!hp4nl!alchemy!edwin
Newsgroups: news.software.nntp
Organization: Utrecht University, Dept. of Computer Science
Lines: 49