Commit 12e1dcd1 authored by Nils Goroll's avatar Nils Goroll

Turn an impossible condition into an assertion

req->restarts only gets incremented in cnt_restart, so it will never
exceed max_restarts here.

Related to #2405
parent 8633ce15
......@@ -160,9 +160,7 @@ cnt_deliver(struct worker *wrk, struct req *req)
VCL_deliver_method(req->vcl, wrk, req, NULL, NULL);
VSLb_ts_req(req, "Process", W_TIM_real(wrk));
/* Stop the insanity before it turns "Hotel California" on us */
if (req->restarts >= cache_param->max_restarts)
wrk->handling = VCL_RET_DELIVER;
assert(req->restarts <= cache_param->max_restarts);
if (wrk->handling != VCL_RET_DELIVER) {
(void)HSH_DerefObjCore(wrk, &req->objcore, HSH_RUSH_POLICY);
......
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