Content-Length patch when streaming enabled

Jammy jammy.linux at gmail.com
Tue Jan 29 05:34:13 CET 2013


From f4fde2d6247463621b3181396e7b14897f1be903 Mon Sep 17 00:00:00 2001
From: ijammy <mzhang at yottaa.com>
Date: Tue, 29 Jan 2013 12:31:08 +0800
Subject: [PATCH] when streaming enabled, if we need gzip or ungzip, won't set
 content-length

---
 bin/varnishd/cache_response.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/varnishd/cache_response.c b/bin/varnishd/cache_response.c
index f22d48a..a16b6df 100644
--- a/bin/varnishd/cache_response.c
+++ b/bin/varnishd/cache_response.c
@@ -351,7 +351,7 @@ RES_StreamStart(struct sess *sp)
 	if (sp->wrk->res_mode & RES_GUNZIP)
 		http_Unset(sp->wrk->resp, H_Content_Encoding);
 
-	if (!(sp->wrk->res_mode & RES_CHUNKED) &&
+	if ((sp->wrk->res_mode & RES_LEN) &&
 	    sp->wrk->h_content_length != NULL)
 		http_PrintfHeader(sp->wrk, sp->fd, sp->wrk->resp,
 		    "Content-Length: %s", sp->wrk->h_content_length);
-- 
1.7.10.2 (Apple Git-33)



-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-when-streaming-enabled-if-we-need-gzip-or-ungzip-won.patch
Type: application/octet-stream
Size: 913 bytes
Desc: not available
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-dev/attachments/20130129/287645b1/attachment.obj>
-------------- next part --------------

----------------------------------
Best wishes,
Jammy








More information about the varnish-dev mailing list