From: Brian Pane Date: Mon, 22 Apr 2002 05:05:50 +0000 (+0000) Subject: Optimization: short-circuit out of ap_set_byterange() more quickly if the X-Git-Tag: 2.0.36~124 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a040b262c573b381a29bfd0c5bc04d0046af63e4;p=apache Optimization: short-circuit out of ap_set_byterange() more quickly if the client isn't requesting a range git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94746 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index 84c171873e..363305869c 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -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.