[4.0] 13d7ff6 Add T to ISO8601 format.

Lasse Karstensen lkarsten at varnish-software.com
Thu Jan 15 16:35:44 CET 2015


commit 13d7ff6f7922647052f5689eaec20c23a23e2c26
Author: Lasse Karstensen <lkarsten at varnish-software.com>
Date:   Wed Jan 14 12:30:48 2015 +0100

    Add T to ISO8601 format.
    
    Since we have been accepting ISO8601 without timezone up until now,
    continue doing so until 4.0 EOL.
    
    Based on 60c98eb by Federico G. Schwindt.

diff --git a/bin/varnishtest/tests/m00020.vtc b/bin/varnishtest/tests/m00020.vtc
index 3611cc4..c31eb24 100644
--- a/bin/varnishtest/tests/m00020.vtc
+++ b/bin/varnishtest/tests/m00020.vtc
@@ -28,6 +28,9 @@ client c1 {
 	txreq -hdr "X-Date: Mon Dec 20 00:00:00 2010"
 	rxresp
 	expect resp.http.x-past == 1
+	txreq -hdr "X-Date: 2030-12-20 00:00:00"
+	rxresp
+	expect resp.http.x-future == 1
 	txreq -hdr "X-Date: 2030-12-20T00:00:00"
 	rxresp
 	expect resp.http.x-future == 1
diff --git a/lib/libvarnish/vtim.c b/lib/libvarnish/vtim.c
index 50033c2..3a3ad7e 100644
--- a/lib/libvarnish/vtim.c
+++ b/lib/libvarnish/vtim.c
@@ -115,7 +115,8 @@ static const char *fmts[] = {
 	"%a, %d %b %Y %T GMT",	/* RFC 822 & RFC 1123 */
 	"%A, %d-%b-%y %T GMT",	/* RFC 850 */
 	"%a %b %d %T %Y",	/* ANSI-C asctime() */
-	"%F %T",		/* ISO 8601 */
+	"%F %T",		/* ISO 8601 (incorrect, only in 4.0) */
+	"%FT%T",		/* ISO 8601 */
 	NULL
 };
 
diff --git a/lib/libvmod_std/vmod_std_conversions.c b/lib/libvmod_std/vmod_std_conversions.c
index 0771687..181f9f9 100644
--- a/lib/libvmod_std/vmod_std_conversions.c
+++ b/lib/libvmod_std/vmod_std_conversions.c
@@ -222,7 +222,7 @@ vmod_time2real(const struct vrt_ctx *ctx, VCL_TIME t)
 }
 
 VCL_TIME __match_proto__(td_std_time)
-vmod_time(VRT_CTX, VCL_STRING p, VCL_TIME d)
+vmod_time(const struct vrt_ctx *ctx, VCL_STRING p, VCL_TIME d)
 {
 	double r;
 



More information about the varnish-commit mailing list