From a7bc1f3efab54aea6e413330f1cd317f2fad3550 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 16 Apr 2001 21:16:53 +0000 Subject: [PATCH] If a higher-level filter handles the the byterange aspects of a request, then the byterange filter should not try to redo the work. The most common case of this happening, is a byterange request going through the proxy, and the origin server handles the byterange request. The proxy should ignore it. Submitted by: Graham Leggett git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88873 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 7 +++++++ modules/http/http_protocol.c | 12 ++++++++++++ 2 files changed, 19 insertions(+) diff --git a/CHANGES b/CHANGES index 8786951866..cc58874a1a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,12 @@ Changes with Apache 2.0.17-dev + *) If a higher-level filter handles the the byterange aspects of a + request, then the byterange filter should not try to redo the + work. The most common case of this happening, is a byterange + request going through the proxy, and the origin server handles + the byterange request. The proxy should ignore it. + [Graham Leggett ] + *) Changed the threaded mpm to have child_main join to each of the worker threads to make sure the kids are all gone before child_main exits after a signal (cleanup from perform_idle_server_maintenance). diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index e4d45c8e65..9d765249d9 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -2347,6 +2347,18 @@ static int ap_set_byterange(request_rec *r) if (r->assbackwards) 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). -- 2.40.0