[master] d0e12c7f4 Fix max_esi_depth check with onerror=abort

Nils Goroll nils.goroll at uplex.de
Mon Jun 12 18:38:10 UTC 2023


commit d0e12c7f41e58ae32c168af953f2bb2620823dcb
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Mon Jun 12 20:30:50 2023 +0200

    Fix max_esi_depth check with onerror=abort
    
    This was meant to be tested by 054215b51ede8caefa856e27e8328fac0ddba737,
    but the test did not attempt to receive a second chunk, so it succeeded
    when it should not have.
    
    Fixes #3938

diff --git a/bin/varnishd/cache/cache_esi_deliver.c b/bin/varnishd/cache/cache_esi_deliver.c
index 6ebb063bb..82e6bc7a1 100644
--- a/bin/varnishd/cache/cache_esi_deliver.c
+++ b/bin/varnishd/cache/cache_esi_deliver.c
@@ -127,6 +127,8 @@ ved_include(struct req *preq, const char *src, const char *host,
 		VSLb(preq->vsl, SLT_VCL_Error,
 		    "ESI depth limit reach (param max_esi_depth = %u)",
 		    cache_param->max_esi_depth);
+		if (!ecx->incl_cont)
+			preq->top->topreq->vdc->retval = -1;
 		return;
 	}
 
diff --git a/bin/varnishtest/tests/r03865.vtc b/bin/varnishtest/tests/r03865.vtc
index 3bb1994e5..aba495f27 100644
--- a/bin/varnishtest/tests/r03865.vtc
+++ b/bin/varnishtest/tests/r03865.vtc
@@ -34,6 +34,7 @@ client c1 {
 	rxresphdrs
 	expect resp.status == 200
 	rxchunk
+	rxchunk
 	expect_close
 	expect resp.body == "before "
 } -run
@@ -46,6 +47,7 @@ client c1 {
 	rxresphdrs
 	expect resp.status == 200
 	rxchunk
+	rxchunk
 	expect_close
 	expect resp.body == "before "
 } -run


More information about the varnish-commit mailing list