apr_pool_cleanup_register(pool, (void *)f, modperl_filter_f_cleanup, apr_pool_cleanup_null);
void modperl_filter_runtime_add(pTHX_ request_rec *r, conn_rec *c,                                const char *name,                                modperl_filter_mode_e mode,                                modperl_filter_add_t addfunc,                                SV *callback, const char *type){    apr_pool_t *pool = r ? r->pool : c->pool;    char *handler_name;    if ((handler_name = modperl_mgv_name_from_sv(aTHX_ pool, callback))) {        ap_filter_t *f;        modperl_handler_t *handler =            modperl_handler_new(pool, apr_pstrdup(pool, handler_name));        modperl_filter_ctx_t *ctx =            (modperl_filter_ctx_t *)apr_pcalloc(pool, sizeof(*ctx));        ctx->handler = handler;        f = addfunc(name, (void*)ctx, r, c);        /* has to resolve early so we can check for init functions */         if (!modperl_mgv_resolve(aTHX_ handler, pool, handler->name, TRUE)) {            Perl_croak(aTHX_ "unable to resolve handler %s\n", handler->name);        }        /* verify that the filter handler is of the right kind */        if (r == NULL) {            /* needs to have the FilterConnectionHandler attribute */            if (!(handler->attrs & MP_FILTER_CONNECTION_HANDLER)) {                Perl_croak(aTHX_ "Can't add connection filter handler '%s' "                           "since it doesn't have the "                           "FilterConnectionHandler attribute set",                           handler->name);            }        }        else {            /* needs to have the FilterRequestHandler attribute, but             * since by default request filters are not required to             * have the FilterRequestHandler attribute, croak only if             * some other attribute is set, but not             * FilterRequestHandler */            if (handler->attrs &&                !(handler->attrs & MP_FILTER_REQUEST_HANDLER)) {                Perl_croak(aTHX_ "Can't add request filter handler '%s' "                           "since it doesn't have the "                           "FilterRequestHandler attribute set",                           handler->name);            }        }        if (handler->attrs & MP_FILTER_HAS_INIT_HANDLER && handler->next) {            int status = modperl_run_filter_init(f, mode, handler->next);            if (status != OK) {                /* XXX */            }        }                MP_TRACE_h(MP_FUNC, "%s handler %s configured (connection)\n",                   type, name);        return;    }    Perl_croak(aTHX_ "unable to resolve handler 0x%lx\n",               (unsigned long)callback);}