[master] 344c017 Fix a testcase to not restart from vcl_backend_reponse{} and fix the bug (category: "How did _that_ ever work") this uncovered.
Poul-Henning Kamp
phk at varnish-cache.org
Mon May 6 13:05:03 CEST 2013
commit 344c0175b8b42aa32b416bcb648bab22825b7fcf
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Mon May 6 11:04:16 2013 +0000
Fix a testcase to not restart from vcl_backend_reponse{} and
fix the bug (category: "How did _that_ ever work") this uncovered.
diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c
index df19c30..b68f2ea 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -167,7 +167,8 @@ cnt_prepresp(struct worker *wrk, struct req *req)
break;
if (bo != NULL) {
AN(bo->do_stream);
- (void)HSH_Deref(&wrk->stats, NULL, &req->obj);
+ assert(req->obj == bo->fetch_obj);
+ req->obj = NULL;
VBO_DerefBusyObj(wrk, &req->busyobj);
} else {
(void)HSH_Deref(&wrk->stats, NULL, &req->obj);
diff --git a/bin/varnishtest/tests/c00055.vtc b/bin/varnishtest/tests/c00055.vtc
index 5bc57f2..ae98b48 100644
--- a/bin/varnishtest/tests/c00055.vtc
+++ b/bin/varnishtest/tests/c00055.vtc
@@ -15,13 +15,15 @@ varnish v1 -vcl+backend {
C{ VRT_CacheReqBody(ctx, 1000); }C
return (pass);
}
- sub vcl_backend_response {
- if (beresp.http.foo == "BAR") {
+ sub vcl_deliver {
+ if (resp.http.foo == "BAR") {
return (restart);
}
}
} -start
+varnish v1 -cliok "param.set debug +syncvsl"
+
client c1 {
txreq -body "FOO"
rxresp
More information about the varnish-commit
mailing list