]> granicus.if.org Git - apache/commitdiff
fix ap_remove_output_filter; the recent change to use remove_any_filter made
authorDoug MacEachern <dougm@apache.org>
Thu, 30 Aug 2001 05:25:31 +0000 (05:25 +0000)
committerDoug MacEachern <dougm@apache.org>
Thu, 30 Aug 2001 05:25:31 +0000 (05:25 +0000)
it possible to wipe out the entire filter chain.  and then when
ap_finalize_request_protocol was called, r->output_filters was NULL,
preventing data from being flushed to the client.
PR:
Obtained from:
Submitted by:
Reviewed by:

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90801 13f79535-47bb-0310-9956-ffa450edef68

server/util_filter.c

index 57de5a67710b36984a7c640f88a804f8bca53ee5..3735632db1deb753367f5599526c1b56a8629f73 100644 (file)
@@ -180,24 +180,20 @@ static void remove_any_filter(ap_filter_t *f, ap_filter_t **r_filt,
                                    ap_filter_t **c_filt)
 {
     ap_filter_t **curr = r_filt ? r_filt : c_filt;
+    ap_filter_t *fscan = *curr;
 
-    if ((*curr) == f) {
-        if (f->r) {
-            f->r->output_filters = f->r->output_filters->next;
-        }
-        else {
-            f->c->output_filters = f->c->output_filters->next;
-        }
+    if (*curr == f) {
+        *curr = (*curr)->next;
         return;
     }
 
-    while ((*curr) && (*curr)->next != f) {
-        (*curr) = (*curr)->next;
-    }
-    if ((*curr) == NULL) {
-        return;
+    while (fscan->next != f) {
+        if (!(fscan = fscan->next)) {
+            return;
+        }
     }
-    (*curr)->next = f->next;
+
+    fscan->next = f->next;
 }
 
 AP_DECLARE(void) ap_remove_input_filter(ap_filter_t *f)