[4.0] 2f580e2 Fix std.duration documentation of qualifiers

Martin Blix Grydeland martin at varnish-software.com
Thu Mar 13 10:24:26 CET 2014


commit 2f580e27c311060d4fc92fb600ec4aa865c4907d
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Mon Feb 24 13:36:46 2014 +0100

    Fix std.duration documentation of qualifiers
    
    std.duration conversion function has a mandatory qualifier. Change the
    wording from 'can' to 'must' specify the qualifier.
    
    Add a test case for a string without a qualifier.

diff --git a/bin/varnishtest/tests/m00005.vtc b/bin/varnishtest/tests/m00005.vtc
index 2ea397a..aa7143d 100644
--- a/bin/varnishtest/tests/m00005.vtc
+++ b/bin/varnishtest/tests/m00005.vtc
@@ -85,4 +85,10 @@ client c1 {
 	expect resp.http.ttl ==  1000002.000
 	expect resp.bodylen == 1
 
+	txreq -url "/1"  -hdr "ttl: 100"
+	rxresp
+	expect resp.status == 200
+	expect resp.http.ttl == 1000002.000
+	expect resp.bodylen == 1
+
 } -run
diff --git a/lib/libvmod_std/vmod.vcc b/lib/libvmod_std/vmod.vcc
index a777801..a55371c 100644
--- a/lib/libvmod_std/vmod.vcc
+++ b/lib/libvmod_std/vmod.vcc
@@ -111,9 +111,10 @@ Example
 $Function DURATION duration(STRING, DURATION)
 
 Description
-	Converts the string *s* to seconds. *s* can be quantified with
-	the usual s (seconds), m (minutes), h (hours), d (days) and w
-	(weeks) units. If *s* fails to parse, *fallback* will be returned.
+	Converts the string *s* to seconds. *s* must be quantified
+	with the usual s (seconds), m (minutes), h (hours), d (days)
+	and w (weeks) units. If *s* fails to parse, *fallback* will be
+	returned.
 Example
 	set beresp.ttl = std.duration("1w", 3600s);
 



More information about the varnish-commit mailing list