[svn:mod_parrot] r617 - mod_parrot/trunk/src
[email protected] Sat, 28 Feb 2009 09:42:37 -0800 (PST)
| Newsgroups | perl.cvs.mod_parrot |
|---|---|
| Message-ID | <[email protected]> |
Author: jhorwitz
Date: Sat Feb 28 09:42:35 2009
New Revision: 617
Modified:
mod_parrot/trunk/src/mod_parrot.c
Log:
make virtual hosts aware of named context pools
Modified: mod_parrot/trunk/src/mod_parrot.c
==============================================================================
--- mod_parrot/trunk/src/mod_parrot.c (original)
+++ mod_parrot/trunk/src/mod_parrot.c Sat Feb 28 09:42:35 2009
@@ -878,9 +878,10 @@
module *modp;
modparrot_module_info *minfo;
Parrot_PMC sub;
+ server_rec *vs;
int status;
- MP_TRACE_h(s, "in modparrot_meta_open_logs_handler");
+ MP_TRACE_h(s, "in modparrot_meta_open_logs_handler (main server)");
/* initialize context */
if (!(ctxp = init_ctx(s, ptemp, NULL))) {
@@ -917,6 +918,56 @@
status = HTTP_INTERNAL_SERVER_ERROR;
}
+ /* all open_logs handlers must return OK, so stop here if it didn't */
+ if (status != OK) return status;
+
+ /* now do the same thing with each virtual host */
+ for (vs = s->next; vs; vs = vs->next) {
+ modparrot_srv_config *vscfg;
+
+ vscfg = ap_get_module_config(vs->module_config, &parrot_module);
+ if (!(vscfg->option_flags & MP_OPT_ENABLE)) continue;
+
+ MP_TRACE_h(s, "in modparrot_meta_open_logs_handler (s=%p)", vs);
+
+ cloned = clone_ctx_state(ctxp,
+ select_ctx_pool(modp, vs, NULL), vs, ptemp);
+ if (cloned != ctxp) {
+ release_ctx(ctxp);
+ ctxp = cloned;
+ }
+
+ /* reset the server_rec, but everything else should be ok */
+ ctxp->s = vs;
+
+ /* we duplicate some efforts here because we only find out about
+ * named context pools configured from an HLL when we're already in
+ * that HLL's meta handler. got that? */
+
+ /* load ParrotLoad files */
+ modparrot_load_files(ctxp->interp, vs, vscfg->preload);
+
+ /* if we weren't tracing the initialization phase, enable tracing */
+ if (!(vscfg->option_flags & MP_OPT_TRACE_INIT)) {
+ Parrot_set_trace(ctxp->interp, vscfg->trace_flags);
+ }
+
+ /* get HLL config */
+ minfo = (modparrot_module_info *)modp->dynamic_load_handle;
+
+ /* call meta handler */
+ MP_TRACE_h(s, "calling open_logs_handler for %s", minfo->namespace);
+ if (!modparrot_call_meta_handler(ctxp->interp, minfo->namespace,
+ "open_logs_handler", &status)) {
+ MPLOG_ERRORF(s, "no open_logs metahandler found for module '%s'",
+ modp->name);
+ status = HTTP_INTERNAL_SERVER_ERROR;
+ }
+
+ /* all open_logs handlers must return OK, so stop here if it didn't */
+ if (status != OK) break;
+ }
+
/* tell apache we're done */
return status;
}