From: Jim Jagielski Date: Mon, 26 Sep 2011 18:12:41 +0000 (+0000) Subject: Put 0- on the fast-track X-Git-Tag: 2.3.15~191 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7433ead1dbe09f87bda0c14372c8ddcbf338799;p=thirdparty%2Fapache%2Fhttpd.git Put 0- on the fast-track git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1175980 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/http/byterange_filter.c b/modules/http/byterange_filter.c index f796c8d1ff2..560043a363c 100644 --- a/modules/http/byterange_filter.c +++ b/modules/http/byterange_filter.c @@ -208,6 +208,20 @@ static int ap_set_byterange(request_rec *r, apr_off_t clength, } else { /* "5-" */ end = clength - 1; + /* + * special case: 0- + * ignore all other ranges provided + * return as a single range: 0- + */ + if (start == 0) { + num_ranges = 0; + sum_lengths = 0; + in_merge = 1; + oend = end; + ostart = start; + apr_array_clear(*indexes); + break; + } } } @@ -272,7 +286,7 @@ static int ap_set_byterange(request_rec *r, apr_off_t clength, /* If all ranges are unsatisfiable, we should return 416 */ return -1; } - if (sum_lengths >= clength) { + if (sum_lengths > clength) { ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, "Sum of ranges not smaller than file, ignoring."); return 0;