Date: Sun, 01 Jun 1997 01:04:47 +0100 From: Brian Somers <brian@awfulhak.org> To: Terry Lambert <terry@lambert.org> Cc: brian@awfulhak.org (Brian Somers), freebsd-hackers@FreeBSD.ORG, internet@demon.net Subject: Re: fetch Message-ID: <199706010004.BAA10800@awfulhak.demon.co.uk> In-Reply-To: Your message of "Sat, 31 May 1997 11:27:34 PDT." <199705311827.LAA11005@phaeton.artisoft.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> > Hi,
> >
> > My ISP (demon.co.uk) sends http dates like this:
> >
> > Sat, 31-May-97 10:48:56 GMT
> >
> > According to http.c in the fetch sources, it's expecting
> > a full year here, ie.
> >
> > Sat, 31-May-1997 10:48:56 .....
> >
> > Has anyone any objection to me making it allow the first ?
>
> As long as you treat it as the year 0097, no objection at all;
> otherwise you are introducing a year 2000 error.
That's clearly wrong too. There's not much to gain by being
pedantic here. The year 2000 AFAICS is a non-issue as I would
expect this format to say "31-May-101" in 4 years time, and
struct tm expects "year-1900".
rfc822 says that 31-May-97 is ok.
rfc1123 says:
The syntax for the date is hereby changed to:
date = 1*2DIGIT month 2*4DIGIT
All mail software SHOULD use 4-digit years in dates, to ease
the transition to the next century.
And rfc2068 says:
HTTP applications have historically allowed three different formats
for the representation of date/time stamps:
Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123
Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format
The first format is preferred as an Internet standard and represents
a fixed-length subset of that defined by RFC 1123 (an update to RFC
822).
The important bit here is that it specifically says that only the fixed
length version is ok. The next paragraph says:
Note: Recipients of date values are encouraged to be robust in
accepting date values that may have been sent by non-HTTP
applications, as is sometimes the case when retrieving or posting
messages via proxies/gateways to SMTP or NNTP.
So the "spirit" is to be lenient with people, although the letter of
the law says it's gotta be four digit.
I'd therefore consider it reasonable to accept two or three digit
years as being assignable directly to tm_year, and four digit years
as being subject to the "-1900" code.
> Has demon refused to correct their server software? Or have
> they not been asked?
They havn't been asked (yet). I've cc'd them and would expect
a reply sometime soon.
> Terry Lambert
> terry@lambert.org
> ---
> Any opinions in this posting are my own and not those of my present
> or previous employers.
--
Brian <brian@awfulhak.org>, <brian@freebsd.org>
<http://www.awfulhak.org>
Don't _EVER_ lose your sense of humour....
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199706010004.BAA10800>
