[experimental-ims] 8548216 I have not been able to reproduce this exact circumstance, but the fix is readily obvious, so: Tighten requirement for range delivery.

Geoff Simmons geoff at varnish-cache.org
Mon Jan 9 21:51:45 CET 2012


commit 8548216821a2710953f2063be75490bb0d9d7eba
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Sep 6 08:15:06 2011 +0000

    I have not been able to reproduce this exact circumstance, but the
    fix is readily obvious, so:  Tighten requirement for range delivery.
    
    Fixes	#1007

diff --git a/bin/varnishd/cache_response.c b/bin/varnishd/cache_response.c
index c592909..73338f7 100644
--- a/bin/varnishd/cache_response.c
+++ b/bin/varnishd/cache_response.c
@@ -276,9 +276,13 @@ RES_WriteObj(struct sess *sp)
 	 */
 	low = 0;
 	high = sp->obj->len - 1;
-	if (!(sp->wrk->res_mode & (RES_ESI|RES_ESI_CHILD|RES_GUNZIP)) &&
-	    params->http_range_support && sp->obj->response == 200 &&
-	    sp->wantbody && http_GetHdr(sp->http, H_Range, &r))
+	if (
+	    sp->wantbody &&
+	    (sp->wrk->res_mode & RES_LEN) &&
+	    !(sp->wrk->res_mode & (RES_ESI|RES_ESI_CHILD|RES_GUNZIP)) &&
+	    params->http_range_support &&
+	    sp->obj->response == 200 &&
+	    http_GetHdr(sp->http, H_Range, &r))
 		res_dorange(sp, r, &low, &high);
 
 	/*



More information about the varnish-commit mailing list