Commit 93bab76a authored by Yann Ylavic's avatar Yann Ylavic
Browse files

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
parent b4f758c9
Loading
Loading
Loading
Loading
+6 −4
Changes for server/util_filter.c: 6 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -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);
    }
    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;