[master] f989ab248 Stop VCL processing if vcl_recv failed

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Fri Jun 5 14:26:07 UTC 2020


commit f989ab2487c771f1a2a4883461397f74624bde7f
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Fri Jun 5 16:24:27 2020 +0200

    Stop VCL processing if vcl_recv failed
    
    VCL failure should abort execution, but vcl_recv would possibly modify
    req and even continue execution in vcl_hash.
    
    Refs #3303

diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c
index 2a1903957..8c075789f 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -884,6 +884,12 @@ cnt_recv(struct worker *wrk, struct req *req)
 	}
 
 	VCL_recv_method(req->vcl, wrk, req, NULL, NULL);
+
+	if (recv_handling == VCL_RET_FAIL) {
+		req->req_step = R_STP_VCLFAIL;
+		return (REQ_FSM_MORE);
+	}
+
 	if (wrk->handling == VCL_RET_VCL && req->restarts == 0) {
 		// Req_Rollback has happened in VPI_vcl_select
 		assert(WS_Snapshot(req->ws) == req->ws_req);


More information about the varnish-commit mailing list