[master] cfbc169 Don't attempt to fetch nothing

Poul-Henning Kamp phk at varnish-cache.org
Sun Jun 16 15:46:06 CEST 2013


commit cfbc1691c5d5fe6e8efdfa25552f90bf1fb82a9c
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Sun Jun 16 12:44:18 2013 +0000

    Don't attempt to fetch nothing

diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index ae74bd9..b65c60a 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -524,8 +524,8 @@ vbf_fetch_body(struct worker *wrk, void *priv)
 	case BS_LENGTH:
 		cl = vbf_fetch_number(bo->h_content_length, 10);
 
-		bo->vfp->begin(bo, cl > 0 ? cl : 0);
-		if (bo->state == BOS_FETCHING)
+		bo->vfp->begin(bo, cl);
+		if (bo->state == BOS_FETCHING && cl > 0)
 			cls = vbf_fetch_straight(bo, htc, cl);
 		mklen = 1;
 		if (bo->vfp->end(bo))



More information about the varnish-commit mailing list