Hello all,

This patch is a one-liner that resolves issue #1761 for 4.0.3. We were
intermittently getting responses with status 204 that were
chunked-encoded with a single chunk of length 0, but a 204 response
should have no body at all. We haven't seen the error since the patch
was applied.

phk's patch was against trunk at the time, well into the development for
4.1, and couldn't be backported to 4.0.3.

So if there are any further maintenance releases for 4.0.x, I suggest
that this patch be included.


Best,
Geoff
-- 
** * * UPLEX - Nils Goroll Systemoptimierung

Scheffelstraße 32
22301 Hamburg

Tel +49 40 2880 5731
Mob +49 176 636 90917
Fax +49 40 42949753

http://uplex.de
From 0dbed187416e2b4bf22f12deb021839f109c6e58 Mon Sep 17 00:00:00 2001
From: Geoff Simmons <ge...@uplex.de>
Date: Mon, 10 Aug 2015 18:40:38 +0200
Subject: [PATCH] for response status 204, like 304, set the wantbody flag to
 false and remove the Content-Length header

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

diff --git a/bin/varnishd/cache/cache_http1_deliver.c b/bin/varnishd/cache/cache_http1_deliver.c
index 090d83d..827bc62 100644
--- a/bin/varnishd/cache/cache_http1_deliver.c
+++ b/bin/varnishd/cache/cache_http1_deliver.c
@@ -254,7 +254,7 @@ V1D_Deliver(struct req *req, struct busyobj *bo)
 		/* In ESI mode, we can't know the aggregate length */
 		http_Unset(req->resp, H_Content_Length);
 		RFC2616_Weaken_Etag(req->resp);
-	} else if (req->resp->status == 304) {
+	} else if (req->resp->status == 204 || req->resp->status == 304) {
 		http_Unset(req->resp, H_Content_Length);
 		req->wantbody = 0;
 	} else if (bo == NULL &&
-- 
2.1.4

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
varnish-dev mailing list
varnish-dev@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev

Reply via email to