[master] d573f35 Only close backend connection on retry if it has a body

Poul-Henning Kamp phk at FreeBSD.org
Wed May 13 10:16:19 CEST 2015


commit d573f35f63d40f07c1bf4bb4c27ab7c2e0e68176
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon May 11 10:26:48 2015 +0000

    Only close backend connection on retry if it has a body

diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index 38703fe..c36722c 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -286,6 +286,7 @@ vbf_stp_startfetch(struct worker *wrk, struct busyobj *bo)
 
 	assert(bo->state <= BOS_REQ_DONE);
 
+	AZ(bo->htc);
 	i = VDI_GetHdr(wrk, bo);
 
 	now = W_TIM_real(wrk);
@@ -434,7 +435,8 @@ vbf_stp_startfetch(struct worker *wrk, struct busyobj *bo)
 	}
 
 	if (wrk->handling == VCL_RET_RETRY) {
-		bo->doclose = SC_RESP_CLOSE;
+		if (bo->htc->body_status != BS_NONE)
+			bo->doclose = SC_RESP_CLOSE;
 		if (bo->director_state != DIR_S_NULL)
 			VDI_Finish(bo->wrk, bo);
 



More information about the varnish-commit mailing list