Date: Wed, 19 Mar 2014 00:55:12 +0000 (UTC) From: Bryan Drewery <bdrewery@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r263327 - stable/8/lib/libfetch Message-ID: <201403190055.s2J0tCTt043018@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bdrewery Date: Wed Mar 19 00:55:12 2014 New Revision: 263327 URL: http://svnweb.freebsd.org/changeset/base/263327 Log: MFC r263021: Support Last-Modified behind proxies which return UTC instead of GMT. Modified: stable/8/lib/libfetch/http.c Directory Properties: stable/8/lib/libfetch/ (props changed) Modified: stable/8/lib/libfetch/http.c ============================================================================== --- stable/8/lib/libfetch/http.c Wed Mar 19 00:54:43 2014 (r263326) +++ stable/8/lib/libfetch/http.c Wed Mar 19 00:55:12 2014 (r263327) @@ -878,6 +878,12 @@ http_parse_mtime(const char *p, time_t * strncpy(locale, setlocale(LC_TIME, NULL), sizeof(locale)); setlocale(LC_TIME, "C"); r = strptime(p, "%a, %d %b %Y %H:%M:%S GMT", &tm); + /* + * Some proxies use UTC in response, but it should still be + * parsed. RFC2616 states GMT and UTC are exactly equal for HTTP. + */ + if (r == NULL) + r = strptime(p, "%a, %d %b %Y %H:%M:%S UTC", &tm); /* XXX should add support for date-2 and date-3 */ setlocale(LC_TIME, locale); if (r == NULL)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403190055.s2J0tCTt043018>