Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Mar 2014 00:53:24 +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-10@freebsd.org
Subject:   svn commit: r263325 - stable/10/lib/libfetch
Message-ID:  <201403190053.s2J0rPJg042659@svn.freebsd.org>

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

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

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

Modified: stable/10/lib/libfetch/http.c
==============================================================================
--- stable/10/lib/libfetch/http.c	Wed Mar 19 00:38:27 2014	(r263324)
+++ stable/10/lib/libfetch/http.c	Wed Mar 19 00:53:24 2014	(r263325)
@@ -876,6 +876,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?201403190053.s2J0rPJg042659>