[experimental-ims] e5a0c62 Don't try to stream when there is no body.

Geoff Simmons geoff at varnish-cache.org
Tue Jan 24 18:30:28 CET 2012


commit e5a0c62c450dea5efa86919f56fff5a97149b821
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Sun Jan 22 16:24:08 2012 +0100

    Don't try to stream when there is no body.

diff --git a/bin/varnishd/cache/cache_center.c b/bin/varnishd/cache/cache_center.c
index b03ba4b..28ef0bf 100644
--- a/bin/varnishd/cache/cache_center.c
+++ b/bin/varnishd/cache/cache_center.c
@@ -812,6 +812,10 @@ cnt_fetchbody(struct sess *sp, struct worker *wrk, struct req *req)
 	if (!req->wantbody)
 		wrk->busyobj->do_stream = 0;
 
+	/* No reason to try streaming a non-existing body */
+	if (wrk->busyobj->body_status == BS_NONE)
+		wrk->busyobj->do_stream = 0;
+
 	l = http_EstimateWS(wrk->busyobj->beresp,
 	    pass ? HTTPH_R_PASS : HTTPH_A_INS, &nhttp);
 



More information about the varnish-commit mailing list