diff options
author | Brian Pane <brianp@apache.org> | 2002-04-22 07:05:50 +0200 |
---|---|---|
committer | Brian Pane <brianp@apache.org> | 2002-04-22 07:05:50 +0200 |
commit | a040b262c573b381a29bfd0c5bc04d0046af63e4 (patch) | |
tree | a6c6d092b972898cd0ba982559547993aa5540cd | |
parent | Skip a potentially heavyweight call to sysconf, plus some (diff) | |
download | apache2-a040b262c573b381a29bfd0c5bc04d0046af63e4.tar.xz apache2-a040b262c573b381a29bfd0c5bc04d0046af63e4.zip |
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
-rw-r--r-- | modules/http/http_protocol.c | 24 |
1 files changed, 12 insertions, 12 deletions
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. |