[master] 403c75e Bring back STRING + DURATION

Nils Goroll nils.goroll at uplex.de
Fri Feb 3 12:53:04 CET 2017


commit 403c75e8a515896a708bd59f50b14bc7529d6eb8
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Fri Feb 3 12:49:12 2017 +0100

    Bring back STRING + DURATION
    
    This is an (intentional) regression from 6f9595e6563cf53118048bcb5d1591a6b631b84c,
    but I don't see why we should prevent stringifications of DURATION.
    
    Related to #2101 #2102

diff --git a/bin/varnishtest/tests/v00020.vtc b/bin/varnishtest/tests/v00020.vtc
index e7c0bb5..352809f 100644
--- a/bin/varnishtest/tests/v00020.vtc
+++ b/bin/varnishtest/tests/v00020.vtc
@@ -141,6 +141,9 @@ varnish v1 -vcl {
 		else if (4) { }
 		else { }
 	}
+	sub vcl_backend_response {
+		set beresp.http.buzz = "ttl=" + beresp.ttl;
+	}
 }
 
 # XXX: not the most clear error message
@@ -214,13 +217,6 @@ varnish v1 -errvcl {DURATION + STRING not possible.} {
 	}
 }
 
-varnish v1 -errvcl {STRING + DURATION not possible.} {
-	backend b { .host = "127.0.0.1"; }
-	sub vcl_recv {
-		set req.http.foo = "foo" + 1s;
-	}
-}
-
 varnish v1 -errvcl {DURATION + INT not possible.} {
 	backend b { .host = "127.0.0.1"; }
 	sub vcl_recv {
diff --git a/lib/libvcc/vcc_expr.c b/lib/libvcc/vcc_expr.c
index 974a80f..680ebd6 100644
--- a/lib/libvcc/vcc_expr.c
+++ b/lib/libvcc/vcc_expr.c
@@ -1027,7 +1027,6 @@ static const struct adds {
 	{ '+', DURATION,	REAL,		VOID },
 	{ '+', DURATION,	TIME,		VOID },
 	{ '+', DURATION,	STRING,		VOID },
-	{ '+', STRING,		DURATION,	VOID },
 
 	{ EOI, VOID, VOID, VOID }
 };



More information about the varnish-commit mailing list