[master] f464a94 Revive use of the VSL HitPass tag.

Geoff Simmons geoff at uplex.de
Tue Mar 7 18:32:05 CET 2017


commit f464a94cf91e630c241bcf49974655a7d8b24b8b
Author: Geoff Simmons <geoff at uplex.de>
Date:   Tue Mar 7 14:50:19 2017 +0100

    Revive use of the VSL HitPass tag.

diff --git a/bin/varnishd/cache/cache_hash.c b/bin/varnishd/cache/cache_hash.c
index 48e3ec9..7059826 100644
--- a/bin/varnishd/cache/cache_hash.c
+++ b/bin/varnishd/cache/cache_hash.c
@@ -438,6 +438,8 @@ HSH_Lookup(struct req *req, struct objcore **ocp, struct objcore **bocp,
 			assert(oc->objhead == oh);
 			if (oc->flags & OC_F_HFP) {
 				wrk->stats->cache_hitpass++;
+				VSLb(req->vsl, SLT_HitPass, "%u",
+				     ObjGetXID(wrk, oc));
 				oc = NULL;
 			} else if (oc->flags & OC_F_PASS) {
 				wrk->stats->cache_hitmiss++;
diff --git a/bin/varnishtest/tests/c00081.vtc b/bin/varnishtest/tests/c00081.vtc
index 31b79be..0cf9827 100644
--- a/bin/varnishtest/tests/c00081.vtc
+++ b/bin/varnishtest/tests/c00081.vtc
@@ -29,6 +29,10 @@ varnish v1 -vcl+backend {
 
 } -start
 
+logexpect l1 -v v1 -g vxid {
+	expect 1003 *	HitPass "^1002$"
+} -start
+
 client c1 {
 	txreq
 	rxresp
@@ -45,6 +49,8 @@ client c1 {
 	expect resp.http.miss == True
 } -run
 
+logexpect l1 -wait
+
 varnish v1 -expect MAIN.cache_hitpass == 1
 varnish v1 -expect MAIN.cache_miss == 2
 varnish v1 -expect MAIN.cache_hitmiss == 0



More information about the varnish-commit mailing list