From 2ee7eb97bf6a36c0c07327e8801f64e511053c5b Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Fri, 26 Aug 2011 16:58:34 +0000 Subject: [PATCH] More merge fixes... git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1162165 13f79535-47bb-0310-9956-ffa450edef68 --- modules/http/byterange_filter.c | 35 +++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/modules/http/byterange_filter.c b/modules/http/byterange_filter.c index a4564efcd5..84c4ed1ffe 100644 --- a/modules/http/byterange_filter.c +++ b/modules/http/byterange_filter.c @@ -548,22 +548,23 @@ static int ap_set_byterange(request_rec *r, apr_off_t clength, } in_merge = 0; - if (start < ostart) { - ostart = start; - reversals++; - in_merge = 1; - } - else if (start < oend || start == ostart) { - in_merge = 1; - } - if (end >= oend && (start-1) <= oend) { - oend = end; - in_merge = 1; - } - else if (end > ostart && end <= oend) { - in_merge = 1; + if !(iend-1 < ostart || start-1 > oend) { + if (start < ostart) { + ostart = start; + reversals++; + in_merge = 1; + } + else if (start < oend || start == ostart) { + in_merge = 1; + } + if (end >= oend && (start-1) <= oend) { + oend = end; + in_merge = 1; + } + else if (end > ostart && end <= oend) { + in_merge = 1; + } } - if (in_merge) { overlaps++; continue; @@ -574,6 +575,10 @@ static int ap_set_byterange(request_rec *r, apr_off_t clength, idx = (indexes_t *)apr_array_push(indexes); idx->start = ostart; idx->end = oend; + /* new set again */ + in_merge = 1; + ostart = start; + oend = end; num_ranges++; } } -- 2.40.0