[4.0] 8061a7c Rememeber to supress body if we do 304 conditional response.

Poul-Henning Kamp phk at FreeBSD.org
Tue Jun 24 11:31:55 CEST 2014


commit 8061a7c804be67b2b93bf8d7b6de7f5988452c48
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Jun 10 11:15:32 2014 +0000

    Rememeber to supress body if we do 304 conditional response.
    
    Fixes	#1518

diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c
index 4c8ca8e..c586ca4 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -149,8 +149,10 @@ cnt_deliver(struct worker *wrk, struct req *req)
 	if (!(req->obj->objcore->flags & OC_F_PASS)
 	    && req->esi_level == 0
 	    && http_GetStatus(req->obj->http) == 200
-	    && req->http->conds && RFC2616_Do_Cond(req))
+	    && req->http->conds && RFC2616_Do_Cond(req)) {
 		http_PutResponse(req->resp, "HTTP/1.1", 304, NULL);
+		req->wantbody = 0;
+	}
 
 	V1D_Deliver(req);
 	VSLb_ts_req(req, "Resp", W_TIM_real(wrk));



More information about the varnish-commit mailing list