Commit 32ef5dce authored by Nils Goroll's avatar Nils Goroll

Cancel a request for a private (streaming) object from vcl_deliver

for anything but return (deliver)

Fixes #2963
parent 4442c6d7
...@@ -160,6 +160,7 @@ cnt_deliver(struct worker *wrk, struct req *req) ...@@ -160,6 +160,7 @@ cnt_deliver(struct worker *wrk, struct req *req)
assert(req->restarts <= cache_param->max_restarts); assert(req->restarts <= cache_param->max_restarts);
if (wrk->handling != VCL_RET_DELIVER) { if (wrk->handling != VCL_RET_DELIVER) {
HSH_Cancel(wrk, req->objcore, NULL);
(void)HSH_DerefObjCore(wrk, &req->objcore, HSH_RUSH_POLICY); (void)HSH_DerefObjCore(wrk, &req->objcore, HSH_RUSH_POLICY);
http_Teardown(req->resp); http_Teardown(req->resp);
......
varnishtest "Cancel private busy obj from vcl_deliver"
server s1 {
rxreq
expect req.url == "/hfm"
txresp -hdr "HFM: True" -bodylen 65530
rxreq
expect req.url == "/hfp"
txresp -hdr "HFP: True" -bodylen 65550
} -start
varnish v1 -arg "-s Transient=default" -vcl+backend {
sub vcl_recv {
if (req.restarts > 0) {
return (synth(200));
}
}
sub vcl_backend_response {
if (bereq.url == "/hfm") {
set beresp.uncacheable = true;
} else if (bereq.url == "/hfp") {
return (pass(1m));
}
}
sub vcl_deliver {
if (req.restarts == 0) {
return (restart);
}
}
} -start
logexpect l1 -v v1 -g raw {
expect * * Storage "Transient"
expect * * Storage "Transient"
} -start
client c1 {
txreq -url "/hfm"
rxresp
expect resp.status == 200
txreq -url "/hfp"
rxresp
expect resp.status == 200
} -run
logexpect l1 -wait
varnish v1 -expect SM?.Transient.c_bytes > 131072
varnish v1 -expect SM?.Transient.g_bytes < 2000
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