Commit d0fa2ab4 authored by Tollef Fog Heen's avatar Tollef Fog Heen

Add missing bits for string version of "now"


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4788 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 1cc2fc79
# $Id$
# We can't test the value of x-timestamp, but this should fail
# if we can't set the header at all.
test "Test formatting of timestamps"
......@@ -11,6 +13,9 @@ varnish v1 -vcl+backend {
sub vcl_recv {
error 200 req.grace;
}
sub vcl_error {
set obj.http.x-timestamp = now;
}
} -start
client c1 {
......
......@@ -153,6 +153,11 @@ vcc_StringVal(struct tokenlist *tl)
return (vcc_regsub(tl, 0));
if (tl->t->tok == ID && vcc_IdIs(tl->t, "regsuball"))
return (vcc_regsub(tl, 1));
if (tl->t->tok == ID && vcc_IdIs(tl->t, "now")) {
Fb(tl, 0, "VRT_time_string(sp, VRT_r_now(sp))");
vcc_NextToken(tl);
return 1;
}
if (tl->t->tok == VAR) {
vp = vcc_FindVar(tl, tl->t, vcc_vars, 0, "read");
if (tl->err)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment