From: Doug MacEachern Date: Thu, 30 Aug 2001 05:25:31 +0000 (+0000) Subject: fix ap_remove_output_filter; the recent change to use remove_any_filter made X-Git-Tag: 2.0.26~387 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=73b79caab0418cecae84fe472e4c4968017c73a7;p=apache fix ap_remove_output_filter; the recent change to use remove_any_filter made 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 --- diff --git a/server/util_filter.c b/server/util_filter.c index 57de5a6771..3735632db1 100644 --- a/server/util_filter.c +++ b/server/util_filter.c @@ -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)