From: Graham Leggett Date: Fri, 1 Jun 2001 22:14:01 +0000 (+0000) Subject: Optimise reset_filter() in http_protocol.c X-Git-Tag: 2.0.19~152 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a10b0be85c19d1530e47592efe23162eac9f1419;p=thirdparty%2Fapache%2Fhttpd.git Optimise reset_filter() in http_protocol.c PR: Obtained from: Submitted by: Greg Stein Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89256 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index eaf78496b53..c161dab902d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes with Apache 2.0.19-dev + *) Optimise reset_filter() in http_protocol.c. [Greg Stein] + *) Add a check to ap_die() to make sure the filter stack is sane and contains the correct basic filters when an error occurs. This fixes a problem where headers are not being sent on error. [John Sterling] diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index 595c7c25578..2c432e2f9ba 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -1745,20 +1745,10 @@ 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 { - ap_remove_output_filter(f); - f = f->next; - } - } + r->output_filters = NULL; + ap_add_output_filter("CORE", NULL, r, r->connection); + ap_add_output_filter("CONTENT_LENGTH", NULL, r, r->connection); + ap_add_output_filter("HTTP_HEADER", NULL, r, r->connection); } /* We should have named this send_canned_response, since it is used for any