Commit 6944fe82 authored by Nils Goroll's avatar Nils Goroll

respect max_restarts and fix c00028.vtc

Fixes #2949
parent 31ec2bd2
......@@ -272,6 +272,10 @@ cnt_synth(struct worker *wrk, struct req *req)
return (REQ_FSM_DONE);
}
if (wrk->handling == VCL_RET_RESTART &&
req->restarts > cache_param->max_restarts)
wrk->handling = VCL_RET_DELIVER;
if (wrk->handling == VCL_RET_RESTART) {
/*
* XXX: Should we reset req->doclose = SC_VCL_FAILURE
......
......@@ -8,7 +8,11 @@ varnish v1 -vcl {
sub vcl_backend_fetch {
set bereq.backend = bad;
}
sub vcl_backend_error {
return (abandon);
}
sub vcl_synth {
set resp.http.restarts = req.restarts;
return (restart);
}
} -start
......@@ -17,4 +21,5 @@ client c1 {
txreq -url "/"
rxresp
expect resp.status == 503
expect resp.http.restarts == 5
} -run
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