apr_pool_cleanup_register(c->pool, (void *)f, modperl_filter_f_cleanup, apr_pool_cleanup_null);
static int modperl_filter_add_connection(conn_rec *c,                                         int idx,                                         const char *name,                                         modperl_filter_add_t addfunc,                                         const char *type){    modperl_config_dir_t *dcfg =        modperl_config_dir_get_defaults(c->base_server);    MpAV *av;    if ((av = dcfg->handlers_per_dir[idx])) {        modperl_handler_t **handlers = (modperl_handler_t **)av->elts;        int i;        ap_filter_t *f;        for (i=0; i<av->nelts; i++) {            modperl_filter_ctx_t *ctx;            if ((handlers[i]->attrs & MP_FILTER_HTTPD_HANDLER)) {                addfunc(handlers[i]->name, NULL, NULL, c);                MP_TRACE_f(MP_FUNC,                           "a non-mod_perl %s handler %s configured (connection)\n",                           type, handlers[i]->name);                continue;            }                        if (!(handlers[i]->attrs & MP_FILTER_CONNECTION_HANDLER)) {                MP_TRACE_f(MP_FUNC,                           "%s is not a FilterConnection handler\n",                           handlers[i]->name);                continue;            }            ctx = (modperl_filter_ctx_t *)apr_pcalloc(c->pool, sizeof(*ctx));            ctx->handler = handlers[i];            f = addfunc(name, (void*)ctx, NULL, c);            if (handlers[i]->attrs & MP_FILTER_HAS_INIT_HANDLER &&                handlers[i]->next) {                int status = modperl_run_filter_init(                    f,                    (idx == MP_INPUT_FILTER_HANDLER                     ? MP_INPUT_FILTER_MODE : MP_OUTPUT_FILTER_MODE),                    handlers[i]->next);                if (status != OK) {                    return status;                }            }                        MP_TRACE_h(MP_FUNC, "%s handler %s configured (connection)\n",                       type, handlers[i]->name);        }        return OK;    }    MP_TRACE_h(MP_FUNC, "no %s handlers configured (connection)\n", type);    return DECLINED;}