[svn:mod_parrot] r480 - mod_parrot/trunk/languages/perl6/lib

[email protected] Fri, 7 Nov 2008 07:55:19 -0800 (PST)
Newsgroups perl.cvs.mod_parrot
Message-ID <[email protected]>
Author: jhorwitz
Date: Fri Nov  7 07:55:18 2008
New Revision: 480

Modified:
   mod_parrot/trunk/languages/perl6/lib/mod_perl6.pm

Log:
work around segfault in post_config metahandler when Perl6Module is specified
but there is no subsequent post_config handler


Modified: mod_parrot/trunk/languages/perl6/lib/mod_perl6.pm
==============================================================================
--- mod_parrot/trunk/languages/perl6/lib/mod_perl6.pm	(original)
+++ mod_parrot/trunk/languages/perl6/lib/mod_perl6.pm	Fri Nov  7 07:55:18 2008
@@ -33,14 +33,32 @@
 sub server_create()
 {
     my %cfg;
+
+    # preloading
     %cfg<preloaded_modules> = [];
     %cfg<postconfig_requires> = [];
+
+    # server-scope handlers
+    # XXX we shouldn't need to prepopulate these, but things segfault otherwise
+    for <open_logs post_config child_init pre_connection process_connection
+         post_read_request map_to_storage trans> -> $phase {
+        %cfg<$phase ~ '_' ~ 'handler> = undef;
+    }
+
     return %cfg;
 }
 
 sub dir_create()
 {
     my %cfg;
+
+    # section-scope handlers
+    # XXX we shouldn't need to prepopulate these, but things segfault otherwise
+    for <header_parser access authen authz response type fixup log
+         cleanup> -> $phase {
+        %cfg<$phase ~ '_' ~ 'handler> = undef;
+    }
+
     return %cfg;
 }