[master] 7fa4ac7e3 ESI VDP to veto being pushed

Nils Goroll nils.goroll at uplex.de
Sat Apr 4 17:50:13 UTC 2020


commit 7fa4ac7e309f480e3418f79e80d69e96d82e5db9
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Sat Apr 4 18:45:09 2020 +0200

    ESI VDP to veto being pushed
    
    So far, we relied upon esi not being added to resp_filters for no esi
    object, but as the filters can be set freely from VCL, the esi vdp
    itself should veto being pushed if it has not business to do with the
    object at hand.

diff --git a/bin/varnishd/cache/cache_esi_deliver.c b/bin/varnishd/cache/cache_esi_deliver.c
index b4b30fa3f..44d6657b0 100644
--- a/bin/varnishd/cache/cache_esi_deliver.c
+++ b/bin/varnishd/cache/cache_esi_deliver.c
@@ -259,8 +259,13 @@ ved_vdp_esi_init(struct req *req, void **priv)
 {
 	struct ecx *ecx;
 
+	CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
 	AN(priv);
 	AZ(*priv);
+
+	if (!ObjHasAttr(req->wrk, req->objcore, OA_ESIDATA))
+		return (1);
+
 	ALLOC_OBJ(ecx, ECX_MAGIC);
 	AN(ecx);
 	assert(sizeof gzip_hdr == 10);


More information about the varnish-commit mailing list