Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Mar 2014 00:54:44 +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-9@freebsd.org
Subject:   svn commit: r263326 - stable/9/lib/libfetch
Message-ID:  <201403190054.s2J0siNs042829@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bdrewery
Date: Wed Mar 19 00:54:43 2014
New Revision: 263326
URL: http://svnweb.freebsd.org/changeset/base/263326

Log:
  MFC r263021:
  
    Support Last-Modified behind proxies which return UTC instead of GMT.

Modified:
  stable/9/lib/libfetch/http.c
Directory Properties:
  stable/9/lib/libfetch/   (props changed)

Modified: stable/9/lib/libfetch/http.c
==============================================================================
--- stable/9/lib/libfetch/http.c	Wed Mar 19 00:53:24 2014	(r263325)
+++ stable/9/lib/libfetch/http.c	Wed Mar 19 00:54:43 2014	(r263326)
@@ -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?201403190054.s2J0siNs042829>