You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by co...@apache.org on 2011/08/27 22:37:59 UTC

svn commit: r1162440 - /httpd/httpd/trunk/modules/http/byterange_filter.c

Author: covener
Date: Sat Aug 27 20:37:58 2011
New Revision: 1162440

URL: http://svn.apache.org/viewvc?rev=1162440&view=rev
Log:
merge some more adjacent ranges such as a-n,n+1-b, and
refactor/reduce the tests on the start/end positions.


Modified:
    httpd/httpd/trunk/modules/http/byterange_filter.c

Modified: httpd/httpd/trunk/modules/http/byterange_filter.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/byterange_filter.c?rev=1162440&r1=1162439&r2=1162440&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http/byterange_filter.c (original)
+++ httpd/httpd/trunk/modules/http/byterange_filter.c Sat Aug 27 20:37:58 2011
@@ -531,24 +531,21 @@ static int ap_set_byterange(request_rec 
             continue;
         }
         in_merge = 0;
+      
+        if (start >= ostart && end <= oend) { 
+            in_merge = 1;
+        } 
 
-        if (!(end <= 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 (start < ostart && end >= ostart-1) {
+            ostart = start;
+            reversals++;
+            in_merge = 1;
         }
+        if (end >= oend && start <= oend+1 ) {
+            oend = end;
+            in_merge = 1;
+        }
+
         if (in_merge) {
             overlaps++;
             continue;