Article View: news.software.nntp
Article #18277Re: "NNTP-Posting-Date" with patch
From: C.S.Chen
Date: Thu, 05 Jun 1997 00:00
Date: Thu, 05 Jun 1997 00:00
84 lines
3459 bytes
3459 bytes
Brian Tao (taob@nbc.netcom.ca) you wrote:�:
:
: + /* NNTP-Posting date; set. */
: + t = time((time_t *)NULL);
: + (void)strftime(datebuff, 40, "%d %b %Y %T %Z", localtime(&t));
: + HDR(_nntppostdate) = datebuff;
There is some minor bug of this patch.
The same character array 'databuff' is defined twice. Both used for
the "Date:" header & "NNTP-Posting-Date:" header.
At last, the content of the header "Date:" and "NNTP-Posting-Date:"
are of the same. That is not good, since "Date" is usually indicated
in GMT timezone.
I think the second one should be changed to something like "datebuff2".
I'd implemented it, and it fixed the problem.
I'd done some other patches before. So the line number shown is not the
same as the origin one in inn-1.5.1.
# diff post.c post.c-old
261d260
< static char datebuff2[40];
437,438c436,437
< (void)strftime(datebuff2, 40, "%d %b %Y %T %Z", localtime(&t));
< HDR(_nntppostdate) = datebuff2;
---
> (void)strftime(datebuff, 40, "%d %b %Y %T %Z", localtime(&t));
> HDR(_nntppostdate) = datebuff;
Here are some sample posts before and after the patch.
-------------------------------------------------------
Path: netnews.NCTU.edu.tw!not-for-mail
From: chen@cc.nctu.edu.tw (C.S.Chen)
Newsgroups: nctu.test
Subject: Re: ignore
Date: 05 Jun 1997 09:18:53 CST
^^^^^^^^^^^^^^^^^^^^^^^^
Organization: National Chiao Tung University, Hsinchu, Taiwan
Lines: 5
Message-ID: <5n545t$61b$1@news2.nctu.edu.tw>
References: <3393D42E.1B89@cc.nctu.edu.tw> <3395272B.2284@cc.nctu.edu.tw>
Reply-To: chen@ccnews.nctu.edu.tw
NNTP-Posting-Host: ccsun6.cc.nctu.edu.tw
NNTP-Posting-Date: 05 Jun 1997 09:18:53 CST
^^^^^^^^^^^^^^^^^^^^^^^^
X-Newsreader: TIN [UNIX 1.3 950824BETA+ANSI+COLOR PL6]
Xref: netnews.NCTU.edu.tw nctu.test:20558
sfsdf
--
Joe. C.S.Chen
------------------------------------------------------
After the patching.
Path: netnews.NCTU.edu.tw!news2!not-for-mail
From: cschen@cc.nctu.edu.tw (C.S.Chen)
Newsgroups: nctu.test
Subject: Re: ignore
Date: 5 Jun 1997 16:31:32 GMT
^^^^^^^^^^^^^^^^^^^^^^^
Organization: National Chiao Tung University, Hsinchu, Taiwan
Lines: 7
Message-ID: <5n6pl4$m0t$1@news2.nctu.edu.tw>
References: <3393D42E.1B89@cc.nctu.edu.tw> <3395272B.2284@cc.nctu.edu.tw> <5n545t$61b$1@news2.nctu.edu.tw>
NNTP-Posting-Host: localhost
NNTP-Posting-Date: 06 Jun 1997 00:31:32 CST
^^^^^^^^^^^^^^^^^^^^^^^^
X-Newsreader: TIN [UNIX 1.3 950824BETA+ANSI+COLOR PL8]
Xref: netnews.NCTU.edu.tw nctu.test:20563
C.S.Chen (chen@cc.nctu.edu.tw) you wrote:
: sfsdf
: --
abcd
--
Joe. C.S.Chen, cschen@ns.nctu.edu.tw
Technical Details
Message-ID:
<5n6r04$mer$1@news2.nctu.edu.tw>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-mailReferences:
<5mtl3h$2fo@tor-nn1-hb0.netcom.ca> <5mtmrn$sm5$1@news.cmc.net> <5mukc1$q3n@tor-nn1-hb0.netcom.ca> <5muoor$18v@tor-nn1-hb0.netcom.ca>Show Full Headers
Complete Article Headers
Message-ID: <5n6r04$mer$1@news2.nctu.edu.tw> Subject: Re: "NNTP-Posting-Date" with patch Date: Thu, 05 Jun 1997 00:00:00 +0000 From: cschen@cc.nctu.edu.tw (C.S.Chen) References: <5mtl3h$2fo@tor-nn1-hb0.netcom.ca> <5mtmrn$sm5$1@news.cmc.net> <5mukc1$q3n@tor-nn1-hb0.netcom.ca> <5muoor$18v@tor-nn1-hb0.netcom.ca> 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: 246409478 Distribution: inet Organization: National Chiao Tung University, Hsinchu, Taiwan NNTP-Posting-Date: 06 Jun 1997 00:54:28 CST Newsgroups: news.software.nntp