]> granicus.if.org Git - apache/commitdiff
Optimization: short-circuit out of ap_set_byterange() more quickly if the
authorBrian Pane <brianp@apache.org>
Mon, 22 Apr 2002 05:05:50 +0000 (05:05 +0000)
committerBrian Pane <brianp@apache.org>
Mon, 22 Apr 2002 05:05:50 +0000 (05:05 +0000)
client isn't requesting a range

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

modules/http/http_protocol.c

index 84c171873ef40c20a023f57035e770889c92c339..363305869c7c661ef6186631d3eb4441afda9262 100644 (file)
@@ -2809,18 +2809,6 @@ static int ap_set_byterange(request_rec *r)
         return 0;
     }
 
-    /* is content already a single range? */
-    if (apr_table_get(r->headers_out, "Content-Range")) {
-       return 0;
-    }
-
-    /* is content already a multiple range? */
-    if ((ct = apr_table_get(r->headers_out, "Content-Type"))
-        && (!strncasecmp(ct, "multipart/byteranges", 20)
-            || !strncasecmp(ct, "multipart/x-byteranges", 22))) {
-       return 0;
-    }
-
     /* Check for Range request-header (HTTP/1.1) or Request-Range for
      * backwards-compatibility with second-draft Luotonen/Franks
      * byte-ranges (e.g. Netscape Navigator 2-3).
@@ -2839,6 +2827,18 @@ static int ap_set_byterange(request_rec *r)
         return 0;
     }
 
+    /* is content already a single range? */
+    if (apr_table_get(r->headers_out, "Content-Range")) {
+       return 0;
+    }
+
+    /* is content already a multiple range? */
+    if ((ct = apr_table_get(r->headers_out, "Content-Type"))
+        && (!strncasecmp(ct, "multipart/byteranges", 20)
+            || !strncasecmp(ct, "multipart/x-byteranges", 22))) {
+       return 0;
+    }
+
     /* Check the If-Range header for Etag or Date.
      * Note that this check will return false (as required) if either
      * of the two etags are weak.