]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Optimise reset_filter() in http_protocol.c
authorGraham Leggett <minfrin@apache.org>
Fri, 1 Jun 2001 22:14:01 +0000 (22:14 +0000)
committerGraham Leggett <minfrin@apache.org>
Fri, 1 Jun 2001 22:14:01 +0000 (22:14 +0000)
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

CHANGES
modules/http/http_protocol.c

diff --git a/CHANGES b/CHANGES
index eaf78496b53b7a847adcb938b1204da925c67464..c161dab902dff03bbbe5bf9ef05a6af1c9954bd3 100644 (file)
--- 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]
index 595c7c255782de7a35b8847e556ef9a1b1527661..2c432e2f9ba3ca377d4a6f054d149190b18dd3f9 100644 (file)
@@ -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