[master] 5691cc0db Don't borrow the parent VCL in esi-includes, vcl switching would give subsequent esi-includes the wrong vcl.

Poul-Henning Kamp phk at FreeBSD.org
Tue Dec 11 11:51:12 UTC 2018


commit 5691cc0dbf1f6e59a5f21d4b84047c6cb9371fd6
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Dec 11 08:53:31 2018 +0000

    Don't borrow the parent VCL in esi-includes, vcl switching
    would give subsequent esi-includes the wrong vcl.

diff --git a/bin/varnishd/cache/cache_esi_deliver.c b/bin/varnishd/cache/cache_esi_deliver.c
index c4733af7d..656df25a8 100644
--- a/bin/varnishd/cache/cache_esi_deliver.c
+++ b/bin/varnishd/cache/cache_esi_deliver.c
@@ -163,7 +163,7 @@ ved_include(struct req *preq, const char *src, const char *host,
 
 	AZ(req->vcl);
 	req->vcl = preq->vcl;
-	preq->vcl = NULL;
+	VCL_Ref(req->vcl);
 
 	req->req_step = R_STP_RECV;
 	req->t_req = preq->t_req;
@@ -197,9 +197,7 @@ ved_include(struct req *preq, const char *src, const char *host,
 		AZ(req->wrk);
 	}
 
-	AZ(preq->vcl);
-	preq->vcl = req->vcl;
-	req->vcl = NULL;
+	VCL_Rel(&req->vcl);
 
 	req->wrk = NULL;
 	THR_SetRequest(preq);


More information about the varnish-commit mailing list