diff options
author | Jim Jagielski <jim@apache.org> | 2013-03-19 19:09:40 +0000 |
---|---|---|
committer | Jim Jagielski <jim@apache.org> | 2013-03-19 19:09:40 +0000 |
commit | 42829738d9c0f75607cebab0029c58cad7c6bb72 (patch) | |
tree | 8c32030cc657c1399428d16f3e5f7f1b1399ff74 /server/util_filter.c | |
parent | 44319eb4c031c2c7865a7c7af028685f0b445822 (diff) | |
download | httpd-42829738d9c0f75607cebab0029c58cad7c6bb72.tar.gz |
Useful extensions...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1458456 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/util_filter.c')
-rw-r--r-- | server/util_filter.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/server/util_filter.c b/server/util_filter.c index 7121eced9e..01eb533520 100644 --- a/server/util_filter.c +++ b/server/util_filter.c @@ -479,6 +479,63 @@ AP_DECLARE(void) ap_remove_output_filter(ap_filter_t *f) &f->c->output_filters); } +AP_DECLARE(apr_status_t) ap_remove_input_filter_byhandle(ap_filter_t *next, + const char *handle) +{ + ap_filter_t *found = NULL; + ap_filter_rec_t *filter; + + if (!handle) { + return APR_EINVAL; + } + filter = ap_get_input_filter_handle(handle); + if (!filter) { + return APR_NOTFOUND; + } + + while (next) { + if (next->frec == filter) { + found = next; + break; + } + next = next->next; + } + if (found) { + ap_remove_input_filter(found); + return APR_SUCCESS; + } + return APR_NOTFOUND; +} + +AP_DECLARE(apr_status_t) ap_remove_output_filter_byhandle(ap_filter_t *next, + const char *handle) +{ + ap_filter_t *found = NULL; + ap_filter_rec_t *filter; + + if (!handle) { + return APR_EINVAL; + } + filter = ap_get_output_filter_handle(handle); + if (!filter) { + return APR_NOTFOUND; + } + + while (next) { + if (next->frec == filter) { + found = next; + break; + } + next = next->next; + } + if (found) { + ap_remove_output_filter(found); + return APR_SUCCESS; + } + return APR_NOTFOUND; +} + + /* * Read data from the next filter in the filter stack. Data should be * modified in the bucket brigade that is passed in. The core allocates the |