[master] c7e56c4 Random polishing

Federico G. Schwindt fgsch at lodoss.net
Sat Sep 24 22:02:04 CEST 2016


commit c7e56c424679e0ca63ab90c061defc85822bc56c
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date:   Sat Sep 24 20:58:00 2016 +0100

    Random polishing

diff --git a/bin/varnishtest/tests/v00020.vtc b/bin/varnishtest/tests/v00020.vtc
index 67388a1..9c42c55 100644
--- a/bin/varnishtest/tests/v00020.vtc
+++ b/bin/varnishtest/tests/v00020.vtc
@@ -22,18 +22,6 @@ varnish v1 -errvcl {Found: '0' at} { 0; }
 
 varnish v1 -errvcl {Expected an action, 'if', } " sub vcl_recv { { } { "
 
-varnish v1 -vcl {
-	backend b { .host = "127.0.0.1"; }
-	sub vcl_backend_response {
-		set beresp.ttl = 1w;
-		set beresp.ttl *= 1.5;
-		set beresp.ttl = 1.5 s * 2.5;
-		set beresp.ttl = 1.5 s / 2.5;
-		set beresp.ttl = 1.5h + 1.5s;
-		set beresp.ttl = 1.5h - 1.5s;
-	}
-}
-
 varnish v1 -errvcl {Comparison of different types: INT '!=' STRING} {
 	sub vcl_recv {
 		if (!req.restarts != req.url) {
@@ -109,10 +97,17 @@ varnish v1 -vcl {
 		set req.http.foo = req.http.foo + "bar" !~ "bar";
 
 		set req.ttl = 1s;
+		set req.ttl *= 1.5;
+		set req.ttl = 1.5 s * 2.5;
+		set req.ttl = 1.5 s / 2.5;
+		set req.ttl = 1.5h + 1.5s;
+		set req.ttl = 1.5h - 1.5s;
 
 		if (req.ttl) { }
 		if (!req.ttl) { }
 
+		if (!req.url) { }
+
 		if (1) { }
 	}
 }
@@ -231,14 +226,6 @@ varnish v1 -errvcl {DURATION + STRING not possible.} {
 	}
 }
 
-varnish v1 -vcl {
-	backend b { .host = "127.0.0.1"; }
-	sub vcl_miss {
-		if (!req.url) {
-		}
-	}
-}
-
 varnish v1 -errvcl {Name of function, 'foo-bar', contains illegal character '-'} {
 	backend b { .host = "127.0.0.1"; }
 	sub foo-bar {
diff --git a/doc/sphinx/reference/vcl.rst b/doc/sphinx/reference/vcl.rst
index 4a67afd..0a63f7f 100644
--- a/doc/sphinx/reference/vcl.rst
+++ b/doc/sphinx/reference/vcl.rst
@@ -100,8 +100,8 @@ Time
 ~~~~
 
 VCL has time. A duration can be added to a time to make another time.
-In string context they return a formatted string in RFC1123 format
-(e.g. Sun, 06 Nov 1994 08:49:37 GMT).
+In string context they return a formatted string in RFC1123 format,
+e.g. Sun, 06 Nov 1994 08:49:37 GMT.
 
 The keyword *now* returns a time representing the current time in seconds
 since the Epoch.
@@ -109,8 +109,8 @@ since the Epoch.
 Durations
 ~~~~~~~~~
 
-Durations are defined by a number and a designation. The number can be a real
-so 1.5w is allowed.
+Durations are defined by a number followed by an unit. The number can
+include a fractional part, e.g. 1.5s. The supported units are:
 
   ms
     milliseconds



More information about the varnish-commit mailing list