From: Ryan Bloom Date: Fri, 26 Jan 2001 17:54:06 +0000 (+0000) Subject: Stop using the request filters to filter an error response. This fixes a X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8cd3a68bae6a70bebd33e1791340d7b97848fa95;p=apache Stop using the request filters to filter an error response. This fixes a bug where we were using the byterange filter to filter an error, which caused us to close the connection before we had sent any data. Currently, we only keep the three most important filters, but we may need to add more in the future. I am mostly thinking of the charset translation filter. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87854 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index dcfb1a59b0..8c783c18fb 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with Apache 2.0b1 + *) If we get an error, then we should remove all filters except for + those critical to serving a web page. This fixes a bug, where + error pages were going through the byterange filter, even though + that made no sense. [Ryan Bloom] + *) Relax the syntax checking of Host: headers in order to support iDNS. PR#6635 [Tony Finch] diff --git a/STATUS b/STATUS index a575ea30d6..69ae497eef 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE 2.0 STATUS: -*-text-*- -Last modified at [$Date: 2001/01/26 02:27:03 $] +Last modified at [$Date: 2001/01/26 17:54:03 $] Release: @@ -30,10 +30,6 @@ RELEASE SHOWSTOPPERS: Status: patch brought forward from 1.3.14 WIN32 and OS2 need review [William Rowe, Brian Harvard] - * Error messages are filtered according to the needs of the original - URI. Nothing ensures that they are translated on EBCDIC machines - and *not* translated on ASCII machines. - * Win32: Enable the Windows MPM to honor max_requests_per_child Status: FirstBill will fix this? diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index 434a28cdbf..4a46395d2b 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -3419,7 +3419,25 @@ static const char *get_canned_error_string(int status, */ } } - + +static void reset_filters(request_rec *r) +{ + ap_filter_t *f = r->output_filters; + + while (f) { + if (!strcasecmp(f->frec->name, "CORE") || + !strcasecmp(f->frec->name, "CONTENT_LENGTH") || + !strcasecmp(f->frec->name, "HTTP_HEADER")) { + f = f->next; + continue; + } + else { + f = f->next; + ap_remove_output_filter(f); + } + } +} + /* We should have named this send_canned_response, since it is used for any * response that can be generated by the server from the request record. * This includes all 204 (no content), 3xx (redirect), 4xx (client error), @@ -3437,6 +3455,7 @@ AP_DECLARE(void) ap_send_error_response(request_rec *r, int recursive_error) * this value. */ r->eos_sent = 0; + reset_filters(r); /* * It's possible that the Location field might be in r->err_headers_out