[svn:mod_parrot] r465 - mod_parrot/trunk/src

[email protected] Sat, 18 Oct 2008 09:40:55 -0700 (PDT)
Newsgroups perl.cvs.mod_parrot
Message-ID <[email protected]>
Author: jhorwitz
Date: Sat Oct 18 09:40:49 2008
New Revision: 465

Modified:
   mod_parrot/trunk/src/module.c

Log:
missing config callbacks should be fatal errors
properly register configuration PMCs


Modified: mod_parrot/trunk/src/module.c
==============================================================================
--- mod_parrot/trunk/src/module.c	(original)
+++ mod_parrot/trunk/src/module.c	Sat Oct 18 09:40:49 2008
@@ -142,6 +142,9 @@
                 /* XXX pass in pool and server_rec objects when implemented */
                 srvcfg->cfg = Parrot_call_sub(ctxp->interp,
                     minfo->server_create_sub, "P");
+                if (!PMC_IS_NULL(srvcfg->cfg)) {
+                    Parrot_register_pmc(ctxp->interp, srvcfg->cfg);
+                }
             }
         }
     }
@@ -155,6 +158,9 @@
                 /* XXX pass in pool and server_rec objects when implemented */
                 dircfg->cfg = Parrot_call_sub(ctxp->interp,
                     minfo->dir_create_sub, "P");
+                if (!PMC_IS_NULL(dircfg->cfg)) {
+                    Parrot_register_pmc(ctxp->interp, dircfg->cfg);
+                }
             }
         }
     }
@@ -394,6 +400,13 @@
         data->modp = modp;
         data->func = Parrot_PMC_get_pmc_keyed_str(interp, cmd,
                                         MAKE_PARROT_STRING("func"));
+        if (PMC_IS_NULL(data->func)) {
+            MPLOG_ERRORF(s, "callback not found for directive '%s'", \
+               cmds[i].name);
+            /* XXX is exit() the right thing to do here? */
+            exit(1);
+        }
+
         data->cmd_data = Parrot_PMC_get_pmc_keyed_str(interp, cmd,
                                         MAKE_PARROT_STRING("cmd_data"));
         cmds[i].cmd_data = data;