[experimental-ims] 90b7074 Reintroduce TTL VCL logging that was lost in commit a21746d23d4047ce209a0c283e12ff684f478b72.

Geoff Simmons geoff at varnish-cache.org
Fri Jul 8 11:47:51 CEST 2011


commit 90b7074b4cad090743f5a9797007ab448fa95a39
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Tue Jun 28 15:47:26 2011 +0200

    Reintroduce TTL VCL logging that was lost in commit
    a21746d23d4047ce209a0c283e12ff684f478b72.
    
    Fixes: #941

diff --git a/bin/varnishd/cache_vrt_var.c b/bin/varnishd/cache_vrt_var.c
index 5f3ecb5..297151c 100644
--- a/bin/varnishd/cache_vrt_var.c
+++ b/bin/varnishd/cache_vrt_var.c
@@ -385,10 +385,13 @@ VRT_DO_EXP(req, sp->exp, ttl, )
 VRT_DO_EXP(req, sp->exp, grace, )
 VRT_DO_EXP(req, sp->exp, keep, )
 VRT_DO_EXP(obj, sp->obj->exp, grace, EXP_Rearm(sp->obj))
-VRT_DO_EXP(obj, sp->obj->exp, ttl, EXP_Rearm(sp->obj))
+VRT_DO_EXP(obj, sp->obj->exp, ttl,
+	   EXP_Rearm(sp->obj);
+	   WSP(sp, SLT_TTL, "%u VCL %.0f %.0f", sp->obj->xid, a, sp->t_req))
 VRT_DO_EXP(obj, sp->obj->exp, keep, EXP_Rearm(sp->obj))
 VRT_DO_EXP(beresp, sp->wrk->exp, grace, )
-VRT_DO_EXP(beresp, sp->wrk->exp, ttl, )
+VRT_DO_EXP(beresp, sp->wrk->exp, ttl,
+	   WSP(sp, SLT_TTL, "%u VCL %.0f %.0f", sp->xid, a, sp->t_req))
 VRT_DO_EXP(beresp, sp->wrk->exp, keep, )
 
 /*--------------------------------------------------------------------
diff --git a/bin/varnishtest/tests/r00941.vtc b/bin/varnishtest/tests/r00941.vtc
new file mode 100644
index 0000000..1028e2d
--- /dev/null
+++ b/bin/varnishtest/tests/r00941.vtc
@@ -0,0 +1,24 @@
+varnishtest "beresp.ttl set in vcl takes effect"
+
+server s1 {
+	rxreq
+	txresp -hdr "Cache-control: max-age=1" -body "FOO"
+	rxreq
+	txresp -body "FOOBAR"
+} -start
+
+varnish v1 -vcl+backend {
+	sub vcl_fetch {
+		set beresp.ttl = 1000s;
+	}
+} -start
+
+client c1 {
+	txreq
+	rxresp
+	expect resp.bodylen == 3
+	delay 2
+	txreq
+	rxresp
+	expect resp.bodylen == 3
+} -run



More information about the varnish-commit mailing list