svn commit: r263327 - stable/8/lib/libfetch

Bryan Drewery bdrewery at FreeBSD.org
Wed Mar 19 00:55:12 UTC 2014


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)


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