[master] 138e67f IMS decision is protocol-independent

Poul-Henning Kamp phk at varnish-cache.org
Fri Sep 6 23:50:45 CEST 2013


commit 138e67f6185d943cb0ca8bfa14e018f6a2a62a6f
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Fri Sep 6 17:27:04 2013 +0000

    IMS decision is protocol-independent

diff --git a/bin/varnishd/cache/cache_http1_deliver.c b/bin/varnishd/cache/cache_http1_deliver.c
index 2b55efd..39b70eb 100644
--- a/bin/varnishd/cache/cache_http1_deliver.c
+++ b/bin/varnishd/cache/cache_http1_deliver.c
@@ -242,13 +242,7 @@ V1D_Deliver(struct req *req)
 	if (req->res_mode & RES_GUNZIP)
 		http_Unset(req->resp, H_Content_Encoding);
 
-	if (!(req->obj->objcore->flags & OC_F_PASS)
-	    && req->obj->response == 200
-	    && req->http->conds && RFC2616_Do_Cond(req)) {
-		req->wantbody = 0;
-		http_SetResp(req->resp, "HTTP/1.1", 304, "Not Modified");
-		http_Unset(req->resp, H_Content_Length);
-	} else if (req->res_mode & RES_CHUNKED)
+	if (req->res_mode & RES_CHUNKED)
 		http_SetHeader(req->resp, "Transfer-Encoding: chunked");
 
 	http_SetHeader(req->resp,
diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c
index a50b65c..9e0d35a 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -150,6 +150,14 @@ cnt_deliver(struct worker *wrk, struct req *req)
 
 	assert(wrk->handling == VCL_RET_DELIVER);
 
+	if (!(req->obj->objcore->flags & OC_F_PASS)
+	    && req->obj->response == 200
+	    && req->http->conds && RFC2616_Do_Cond(req)) {
+		req->wantbody = 0;
+		http_SetResp(req->resp, "HTTP/1.1", 304, "Not Modified");
+		// http_Unset(req->resp, H_Content_Length);
+	}
+
 	V1D_Deliver(req);
 
 	/* No point in saving the body if it is hit-for-pass */



More information about the varnish-commit mailing list