svn commit: r263326 - stable/9/lib/libfetch

Bryan Drewery bdrewery at FreeBSD.org
Wed Mar 19 00:54:44 UTC 2014


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)


More information about the svn-src-stable-9 mailing list