summaryrefslogtreecommitdiff
path: root/server/util_filter.c
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2018-07-13 16:04:37 +0000
committerYann Ylavic <ylavic@apache.org>2018-07-13 16:04:37 +0000
commitfdea2be62fbbb2eb592c2f6c75a23db7fd81a851 (patch)
treefc0f2256c4022b70a5dd6a0dd4e6b9cc97014d05 /server/util_filter.c
parent44ebaf0149d5e5726181541fa95666d050024dc4 (diff)
downloadhttpd-fdea2be62fbbb2eb592c2f6c75a23db7fd81a851.tar.gz
util_filter: follow up to r1835640: pending_filter_cleanup() precedence.
Register pending_filter_cleanup() as a normal cleanup (not pre_cleanup) so that the pending filters are still there on pool cleanup, and f->bb is set to NULL where needed. Then is_pending_filter() check is moved where relevant. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1835847 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/util_filter.c')
-rw-r--r--server/util_filter.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/server/util_filter.c b/server/util_filter.c
index ecbb025ea0..ff36a13553 100644
--- a/server/util_filter.c
+++ b/server/util_filter.c
@@ -458,10 +458,9 @@ static apr_status_t pending_filter_cleanup(void *arg)
{
ap_filter_t *f = arg;
- if (is_pending_filter(f)) {
- APR_RING_REMOVE(f, pending);
- APR_RING_ELEM_INIT(f, pending);
- }
+ APR_RING_REMOVE(f, pending);
+ APR_RING_ELEM_INIT(f, pending);
+ f->bb = NULL;
return APR_SUCCESS;
}
@@ -472,7 +471,9 @@ static void remove_any_filter(ap_filter_t *f, ap_filter_t **r_filt, ap_filter_t
ap_filter_t **curr = r_filt ? r_filt : c_filt;
ap_filter_t *fscan = *curr;
- pending_filter_cleanup(f);
+ if (is_pending_filter(f)) {
+ apr_pool_cleanup_run(f->c->pool, f, pending_filter_cleanup);
+ }
if (p_filt && *p_filt == f)
*p_filt = (*p_filt)->next;
@@ -724,7 +725,8 @@ AP_DECLARE(int) ap_filter_prepare_brigade(ap_filter_t *f, apr_pool_t **p)
}
if (!f->bb) {
f->bb = apr_brigade_create(pool, f->c->bucket_alloc);
- apr_pool_pre_cleanup_register(pool, f, pending_filter_cleanup);
+ apr_pool_cleanup_register(pool, f, pending_filter_cleanup,
+ apr_pool_cleanup_null);
}
if (is_pending_filter(f)) {
return DECLINED;