|
|
Author: jhorwitz
Date: Mon Jul 21 11:55:34 2008
New Revision: 369
Modified:
mod_parrot/trunk/src/nci.c
Log:
return array of PMCNULLs if asking for a handler that doesn't exist
Modified: mod_parrot/trunk/src/nci.c
==============================================================================
--- mod_parrot/trunk/src/nci.c (original)
+++ mod_parrot/trunk/src/nci.c Mon Jul 21 11:55:34 2008
@@ -201,6 +201,10 @@
if (!ctxp) return NULL;
if (update) {
+ if (!ctxp->dircfg->handler) {
+ ctxp->dircfg->handler = (modparrot_handler_info *)apr_pcalloc(
+ ctxp->pconf, sizeof(modparrot_handler_info));
+ }
ctxp->dircfg->handler->hll = apr_pstrdup(ctxp->pconf, hll);
ctxp->dircfg->handler->id = apr_pstrdup(ctxp->pconf, id);
}
@@ -210,10 +214,17 @@
/* XXX how do we unregister this after it's used? */
Parrot_register_pmc(interp, handler);
Parrot_PMC_set_intval(interp, handler, 2);
- Parrot_PMC_set_cstring_intkey(interp, handler, 0,
- ctxp->dircfg->handler->hll);
- Parrot_PMC_set_cstring_intkey(interp, handler, 1,
- ctxp->dircfg->handler->id);
+
+ if (ctxp->dircfg->handler) {
+ Parrot_PMC_set_cstring_intkey(interp, handler, 0,
+ ctxp->dircfg->handler ? ctxp->dircfg->handler->hll : "");
+ Parrot_PMC_set_cstring_intkey(interp, handler, 1,
+ ctxp->dircfg->handler ? ctxp->dircfg->handler->id : "");
+ }
+ else {
+ Parrot_PMC_set_pmc_intkey(interp, handler, 0, PMCNULL);
+ Parrot_PMC_set_pmc_intkey(interp, handler, 1, PMCNULL);
+ }
return(handler);
}
|
|