🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #48204

A good way to accept future dated articles

#48204
From: Adam Selene
Date: Wed, 30 Aug 2000 00:00
64 lines
2819 bytes
I'm looking for a good way to accept future dated articles from my feeds
with Date: headers that contain a date several years into the future.

Is there any way to accomplish this, short of changing the following
two snippets from art.c and post.c?

------------------------------ art.c -------------------------------------
    /* Is article too old? */
    p = HDR(_date);
    if ((Data->Posted = parsedate(p, &Now)) == -1) {
	(void)sprintf(buff, "Bad \"Date\" header -- \"%s\"", MaxLength(p, p));
	return buff;
    }
    if (innconf->artcutoff && Data->Posted < Now.time - innconf->artcutoff) {
	(void)sprintf(buff, "Too old -- \"%s\"", MaxLength(p, p));
	return buff;
    }
    if (Data->Posted > Now.time + DATE_FUZZ) {
	(void)sprintf(buff, "Article posted in the future -- \"%s\"",
		MaxLength(p, p));
	return buff;
    }
    Data->Arrived = Now.time;
    p = HDR(_expires);
    Data->Expires = 0;
    if (*p != '\0' && (Data->Expires = parsedate(p, &Now)) == -1) {
#if	0
	(void)sprintf(buff, "Bad \"Expires\" header -- \"%s\"",
		MaxLength(p, p));
	return buff;
#endif
    }
----------------------------- post.c -------------------------------------
    /* Set Date. */
    if (GetTimeInfo(&Now) < 0) {
	(void)sprintf(Error, "Can't get the time, %s", strerror(errno));
	return Error;
    }

    if ((gmt = gmtime(&Now.time)) == NULL)
	    return "Can't get the time";
    (void)sprintf(datebuff, "%d %3.3s %d %02d:%02d:%02d GMT",
	    gmt->tm_mday, &MONTHS[3 * gmt->tm_mon], 1900 + gmt->tm_year,
	    gmt->tm_hour, gmt->tm_min, gmt->tm_sec);

    if (HDR(_date) == NULL)
	HDR(_date) = datebuff;
    else {
	if ((t = parsedate(HDR(_date), &Now)) == -1)
	    return "Can't parse \"Date\" header";
	if (t > Now.time + DATE_FUZZ)
	    return "Article posted in the future";
    }
--------------------------------------------------------------------------

Are these the only two snippets that need to change in order for me to
accept future dated articles?

TIA.


-Adam Selene

Technical Details
Message-ID: <8ojcbm$fca$1@LuNoHoCo.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <8ojcbm$fca$1@LuNoHoCo.com>
Subject: A good way to accept future dated articles
Date: Wed, 30 Aug 2000 00:00:00 +0000
From: Adam Selene <adamselene@earthlink.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
X-Deja-AN: 664389729
Distribution: world
X-Complaints-To: abuse@earthlink.net
X-Trace: newsread2.prod.itd.earthlink.net 967653781 63.15.248.127 (Wed, 30 Aug 2000 09:43:01 PDT)
Organization: LuNoHoCo
User-Agent: tin/1.4.2-20000205 ("Possession") (UNIX) (SunOS/5.7 (i86pc))
NNTP-Posting-Date: Wed, 30 Aug 2000 09:43:01 PDT
Newsgroups: news.software.nntp