Commit 9cd4a900 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

The ESI_VDP would double-close sessions when a flush error happened

before an ESI include at one level, and then again at a higher level.

Fixed by not closing the session in this case, as that will be taken
care of at the end of delivery anyways when V1L_FlushRelease is
called.

Fixes: 		#1737
Submitted by:	Martin
parent 891889f0
......@@ -317,7 +317,6 @@ VDP_ESI(struct req *req, enum vdp_action act, void **priv,
r = (void*)strchr((const char*)q, '\0');
AN(r);
if (VDP_bytes(req, VDP_FLUSH, NULL, 0)) {
SES_Close(req->sp, SC_REM_CLOSE);
ecx->p = ecx->e;
break;
}
......
varnishtest "#1737 - ESI sublevel session close"
# Build a esi request tree that fails on flush before include at two different
# levels. Synchronize a client close after the response headers have been
# received by the client. This produces write erros for the body parts in all
# fragments.
server s1 {
rxreq
txresp -body {<esi:include src="/bar"/><esi:include src="/bar"/>}
sema r1 sync 2
rxreq
delay 1
txresp -body {<esi:include src="/baz"/>22<esi:include src="/baz"/>}
rxreq
txresp -body {1}
rxreq
expect req.url == "/check"
rxresp
} -start
varnish v1 -vcl+backend {
sub vcl_backend_response {
set beresp.do_esi = true;
}
} -start
# Send request, read response headers then close connection
client c1 {
txreq
rxresp -no_obj
sema r1 sync 2
} -run
delay 3
# Check that Varnish is alive
client c1 {
txreq
rxresp
} -run
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment