Mailing List Archive

[master] f989ab248 Stop VCL processing if vcl_recv failed
commit f989ab2487c771f1a2a4883461397f74624bde7f
Author: Dridi Boukelmoune <dridi.boukelmoune@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);
_______________________________________________
varnish-commit mailing list
varnish-commit@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit