INN commit: trunk/lib (date.c sendarticle.c)
INN Commit
Russ_Allbery at isc.org
Sun Sep 7 13:31:59 UTC 2008
Date: Sunday, September 7, 2008 @ 06:31:58
Author: iulius
Revision: 8016
Clarify the date according to RFC 3977.
Modified:
trunk/lib/date.c
trunk/lib/sendarticle.c
---------------+
date.c | 11 +++--------
sendarticle.c | 2 +-
2 files changed, 4 insertions(+), 9 deletions(-)
Modified: date.c
===================================================================
--- date.c 2008-09-07 12:03:26 UTC (rev 8015)
+++ date.c 2008-09-07 13:31:58 UTC (rev 8016)
@@ -356,8 +356,7 @@
struct tm *current;
int century;
- /* Accept YYMMDD and YYYYMMDD. The first is what RFC 977 requires. The
- second is what the revision of RFC 977 will require. */
+ /* Accept YYMMDD and YYYYMMDD. */
datelen = strlen(date);
if ((datelen != 6 && datelen != 8) || strlen(hour) != 6)
return (time_t) -1;
@@ -382,15 +381,11 @@
/* Four-digit years are the easy case.
- For two-digit years, RFC 977 says "The closest century is assumed as
- part of the year (i.e., 86 specifies 1986, 30 specifies 2030, 99 is
- 1999, 00 is 2000)." draft-ietf-nntpext-base-10.txt simplifies this
- considerably and is what we implement:
+ For two-digit years, RFC 3977 says:
If the first two digits of the year are not specified, the year is
to be taken from the current century if YY is smaller than or equal
- to the current year, otherwise the year is from the previous
- century.
+ to the current year, and the previous century otherwise.
This implementation assumes "current year" means the last two digits
of the current year. Note that this algorithm interacts poorly with
Modified: sendarticle.c
===================================================================
--- sendarticle.c 2008-09-07 12:03:26 UTC (rev 8015)
+++ sendarticle.c 2008-09-07 13:31:58 UTC (rev 8016)
@@ -9,7 +9,7 @@
/*
-** Send a string of one or more lines down a stdio FILE using RFC977
+** Send a string of one or more lines down a stdio FILE using RFC 3977
** conventions. Return -1 on error.
*/
int NNTPsendarticle(char *p, FILE *F, bool Terminate)
More information about the inn-committers
mailing list