[experimental-ims] 7b1006d Reset RES_CHUNKED if we are not sending a body
Geoff Simmons
geoff at varnish-cache.org
Wed Jun 8 14:11:08 CEST 2011
commit 7b1006deafce07616f33cff747d04a46c34b72ff
Author: Tollef Fog Heen <tfheen at varnish-software.com>
Date: Wed Jun 8 09:39:32 2011 +0200
Reset RES_CHUNKED if we are not sending a body
We were accidentially sending an end-chunk in some cases where a
response was bodyless such as for 304s.
diff --git a/bin/varnishd/cache_response.c b/bin/varnishd/cache_response.c
index 4b4b46b..f52eb4b 100644
--- a/bin/varnishd/cache_response.c
+++ b/bin/varnishd/cache_response.c
@@ -365,6 +365,9 @@ RES_WriteObj(struct sess *sp)
sp->acct_tmp.hdrbytes +=
http_Write(sp->wrk, sp->wrk->resp, 1);
+ if (!sp->wantbody)
+ sp->wrk->res_mode &= ~RES_CHUNKED;
+
if (sp->wrk->res_mode & RES_CHUNKED)
WRW_Chunked(sp->wrk);
More information about the varnish-commit
mailing list