PERL_SET_CONTEXT(aTHX);
int modperl_run_handlers(int idx, request_rec *r, conn_rec *c,                         server_rec *s, int type){#ifdef USE_ITHREADS    pTHX;    modperl_interp_t *interp = NULL;#endif    MP_dSCFG(s);    MP_dDCFG;    modperl_handler_t **handlers;    MpAV *av = NULL;    int i, status = OK;    const char *desc = NULL;    switch (type) {      case MP_HANDLER_TYPE_DIR:        av = dcfg->handlers[idx];        MP_TRACE_a_do(desc = modperl_per_dir_handler_desc(idx));        break;      case MP_HANDLER_TYPE_SRV:        av = scfg->handlers[idx];        MP_TRACE_a_do(desc = modperl_per_srv_handler_desc(idx));        break;      case MP_HANDLER_TYPE_CONN:        av = scfg->connection_cfg->handlers[idx];        MP_TRACE_a_do(desc = modperl_connection_handler_desc(idx));        break;      case MP_HANDLER_TYPE_FILE:        av = scfg->files_cfg->handlers[idx];        MP_TRACE_a_do(desc = modperl_files_handler_desc(idx));        break;      case MP_HANDLER_TYPE_PROC:        av = scfg->process_cfg->handlers[idx];        MP_TRACE_a_do(desc = modperl_process_handler_desc(idx));        break;    };    if (!av) {        MP_TRACE_h(MP_FUNC, "no %s handlers configured (%s)\n",                   desc, r ? r->uri : "");        return DECLINED;    }#ifdef USE_ITHREADS    if (r || c) {        interp = modperl_interp_select(r, c, s);        aTHX = interp->perl;    }    else {        /* Child{Init,Exit}, OpenLogs */        aTHX = scfg->mip->parent->perl;    }#endif    MP_TRACE_h(MP_FUNC, "running %d %s handlers\n",               av->nelts, desc);    handlers = (modperl_handler_t **)av->elts;    for (i=0; i<av->nelts; i++) {        status = modperl_callback(aTHX_ handlers[i]);        MP_TRACE_h(MP_FUNC, "%s returned %d\n",                   handlers[i]->name, status);    }#ifdef USE_ITHREADS    if (interp && MpInterpPUTBACK_On(interp)) {        /* XXX: might want to put interp back into available pool         * rather than have it marked as in_use for the lifetime of         * a request         */    }#endif    return status;}