scfg = modperl_config_srv_new(p);
scfg = modperl_config_srv_new(p, s);
static const char *modperl_module_cmd_take123(cmd_parms *parms,                                              void *mconfig,                                              const char *one,                                              const char *two,                                              const char *three){    modperl_module_cfg_t *cfg = (modperl_module_cfg_t *)mconfig;    const char *retval = NULL, *errmsg;    const command_rec *cmd = parms->cmd;    server_rec *s = parms->server;    apr_pool_t *p = parms->pool;    modperl_module_cmd_data_t *info =        (modperl_module_cmd_data_t *)cmd->cmd_data;    modperl_module_info_t *minfo = MP_MODULE_INFO(info->modp);    modperl_module_cfg_t *srv_cfg;    int modules_alias = 0;#ifdef USE_ITHREADS    modperl_interp_t *interp = modperl_interp_pool_select(p, s);    dTHXa(interp->perl);#endif    int count;    PTR_TBL_t *table = modperl_module_config_table_get(aTHX_ TRUE);    SV *obj = Nullsv;    dSP;    if (s->is_virtual) {        MP_dSCFG(s);        /* if the Perl module is loaded in the base server and a vhost         * has configuration directives from that module, but no         * mod_perl.c directives, scfg == NULL when         * modperl_module_cmd_take123 is run. If the directive         * callback wants to do something with the mod_perl config         * object, it'll segfault, since it doesn't exist yet, because         * this happens before server configs are merged. So we create         * a temp struct and fill it in with things that might be         * needed by the Perl callback.         */        if (!scfg) {            scfg = modperl_config_srv_new(p);            modperl_set_module_config(s->module_config, scfg);            scfg->server = s;        }        /* if PerlLoadModule Foo is called from the base server, but         * Foo's directives are used inside a vhost, we need to         * temporary link to the base server config's 'modules'         * member. e.g. so Apache2::Module->get_config() can be called         * from a custom directive's callback, before the server/vhost         * config merge is performed         */        if (!scfg->modules) {            modperl_config_srv_t *base_scfg =                modperl_config_srv_get(modperl_global_get_server_rec());            if (base_scfg->modules) {                scfg->modules = base_scfg->modules;                modules_alias = 1;            }        }    }    errmsg = modperl_module_config_create_obj(aTHX_ p, table, cfg, info,                                              minfo->dir_create,                                              parms, &obj);    if (errmsg) {        return errmsg;    }    if (obj) {        MP_TRACE_c(MP_FUNC, "found per-dir obj=0x%lx for %s.%s\n",                   (unsigned long)obj,                   info->modp->name, cmd->name);    }    /* XXX: could delay creation of srv_obj until     * Apache2::ModuleConfig->get is called.     */    srv_cfg = ap_get_module_config(s->module_config, info->modp);    if (srv_cfg) {        SV *srv_obj;        errmsg = modperl_module_config_create_obj(aTHX_ p, table, srv_cfg, info,                                               minfo->srv_create,                                               parms, &srv_obj);        if (errmsg) {            return errmsg;        }        if (srv_obj) {            MP_TRACE_c(MP_FUNC, "found per-srv obj=0x%lx for %s.%s\n",                       (unsigned long)srv_obj,                       info->modp->name, cmd->name);        }    }    ENTER;SAVETMPS;    PUSHMARK(SP);    EXTEND(SP, 2);    PUSHs(obj);    PUSHs(modperl_bless_cmd_parms(parms));    if (cmd->args_how != NO_ARGS) {        PUSH_STR_ARG(one);        PUSH_STR_ARG(two);        PUSH_STR_ARG(three);    }    PUTBACK;    count = call_method(info->func_name, G_EVAL|G_SCALAR);    SPAGAIN;    if (count == 1) {        SV *sv = POPs;        if (SvPOK(sv) && strEQ(SvPVX(sv), DECLINE_CMD)) {            retval = DECLINE_CMD;        }    }    PUTBACK;    FREETMPS;LEAVE;    if (SvTRUE(ERRSV)) {        retval = SvPVX(ERRSV);    }    if (modules_alias) {        MP_dSCFG(s);        /* unalias the temp aliasing */        scfg->modules = NULL;    }    return retval;}