]> granicus.if.org Git - apache/commitdiff
merge totally reversed ranges like 4-5,1-2 into 1-5
authorGreg Ames <gregames@apache.org>
Sat, 27 Aug 2011 19:57:41 +0000 (19:57 +0000)
committerGreg Ames <gregames@apache.org>
Sat, 27 Aug 2011 19:57:41 +0000 (19:57 +0000)
I interpret the former test
if (!(end <= ostart || start-1 >= oend)) {

as

if (not(end is bad || start is good)) { merge }

ORing the bad condition with the good doesn't produce the desired result.

it is not necessary to test "end" due to the conditions tested in the assert.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1162434 13f79535-47bb-0310-9956-ffa450edef68

modules/http/byterange_filter.c

index 696570610639b705c553c6d842f9dbbf2d8b2e16..e132574d6b21d12bde7d28a2d6aec0a719645a5f 100644 (file)
@@ -531,8 +531,10 @@ static int ap_set_byterange(request_rec *r, apr_off_t clength,
             continue;
         }
         in_merge = 0;
+
+        AP_DEBUG_ASSERT((start <= end) && (ostart <= oend));
         
-        if (!(end <= ostart || start-1 >= oend)) {
+        if (start-1 < oend) {
             if (start < ostart) {
                 ostart = start;
                 reversals++;