Author: stas Date: Fri Dec 10 15:30:14 2004 New Revision: 111554 URL: http://svn.apache.org/viewcvs?view=rev&rev=111554 Log: make sure that modperl's internal post_config callback, which amongst other things, cloning perl interpreters is running as modperl_hook_post_config_last APR_HOOK_REALLY_LAST, which ensures that user's post_config callbacks are run before the cloning. now the code from config phase's startup.pl can be safely moved to the post_config phase's equivalent. - in particular move the contents from modperl_hook_post_config to modperl_hook_post_config_last and eliminate the former - now can start moving code back to post_config callback from the startup phase
Modified: perl/modperl/trunk/Changes perl/modperl/trunk/src/modules/perl/mod_perl.c perl/modperl/trunk/t/conf/modperl_extra.pl perl/modperl/trunk/t/conf/post_config_startup.pl Modified: perl/modperl/trunk/Changes Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/Changes?view=diff&rev=111554&p1=perl/modperl/trunk/Changes&r1=111553&p2=perl/modperl/trunk/Changes&r2=111554 ============================================================================== --- perl/modperl/trunk/Changes (original) +++ perl/modperl/trunk/Changes Fri Dec 10 15:30:14 2004 @@ -12,6 +12,13 @@ =item 1.99_18-dev +make sure that modperl's internal post_config callback, which amongst +other things, cloning perl interpreters is running as +modperl_hook_post_config_last APR_HOOK_REALLY_LAST, which ensures that +user's post_config callbacks are run before the cloning. now the code +from config phase's startup.pl can be safely moved to the post_config +phase's equivalent. [Stas] + Further sync with libapr constants changes: [Stas] - the constants APR::(READ|WRITE|CREATE|APPEND|TRUNCATE|BINARY|EXCL|BUFFERED|DELONCLOSE) Modified: perl/modperl/trunk/src/modules/perl/mod_perl.c Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/src/modules/perl/mod_perl.c?view=diff&rev=111554&p1=perl/modperl/trunk/src/modules/perl/mod_perl.c&r1=111553&p2=perl/modperl/trunk/src/modules/perl/mod_perl.c&r2=111554 ============================================================================== --- perl/modperl/trunk/src/modules/perl/mod_perl.c (original) +++ perl/modperl/trunk/src/modules/perl/mod_perl.c Fri Dec 10 15:30:14 2004 @@ -637,10 +637,17 @@ return OK; } -static int modperl_hook_post_config(apr_pool_t *pconf, apr_pool_t *plog, - apr_pool_t *ptemp, server_rec *s) +static int modperl_hook_post_config_last(apr_pool_t *pconf, apr_pool_t *plog, + apr_pool_t *ptemp, server_rec *s) { -#ifdef USE_ITHREADS + /* in the threaded environment, no server_rec/process_rec + * modifications should be done beyond this point */ + if (modperl_threaded_mpm()) { + MP_threads_started = 1; + } + + MP_post_post_config_phase = 1; + #ifdef USE_ITHREADS MP_dSCFG(s); dTHXa(scfg->mip->parent->perl); #endif @@ -682,20 +689,6 @@ return OK; } -static int modperl_hook_post_config_last(apr_pool_t *pconf, apr_pool_t *plog, - apr_pool_t *ptemp, server_rec *s) -{ - /* in the threaded environment, no server_rec/process_rec - * modifications should be done beyond this point */ - if (modperl_threaded_mpm()) { - MP_threads_started = 1; - } - - MP_post_post_config_phase = 1; - - return OK; -} - static int modperl_hook_create_request(request_rec *r) { MP_dRCFG; @@ -809,9 +802,6 @@ ap_hook_open_logs(modperl_hook_init, NULL, NULL, APR_HOOK_FIRST); - - ap_hook_post_config(modperl_hook_post_config, - NULL, NULL, APR_HOOK_FIRST); ap_hook_post_config(modperl_hook_post_config_last, NULL, NULL, APR_HOOK_REALLY_LAST); Modified: perl/modperl/trunk/t/conf/modperl_extra.pl Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/conf/modperl_extra.pl?view=diff&rev=111554&p1=perl/modperl/trunk/t/conf/modperl_extra.pl&r1=111553&p2=perl/modperl/trunk/t/conf/modperl_extra.pl&r2=111554 ============================================================================== --- perl/modperl/trunk/t/conf/modperl_extra.pl (original) +++ perl/modperl/trunk/t/conf/modperl_extra.pl Fri Dec 10 15:30:14 2004 @@ -37,8 +37,6 @@ test_method_obj(); -test_apache_resource(); - ### only subs below this line ### @@ -154,21 +152,6 @@ $TestModperl::MethodObj = TestModperl::methodobj->new; } -sub test_apache_resource { - ### Apache::Resource tests - - # load first for the menu - require Apache::Status; - - # uncomment for local tests - #$ENV{PERL_RLIMIT_DEFAULTS} = 1; - #$Apache::Resource::Debug = 1; - - # requires optional BSD::Resource - return unless eval { require BSD::Resource }; - - require Apache::Resource; -} sub ModPerl::Test::add_config { my $r = shift; Modified: perl/modperl/trunk/t/conf/post_config_startup.pl Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/conf/post_config_startup.pl?view=diff&rev=111554&p1=perl/modperl/trunk/t/conf/post_config_startup.pl&r1=111553&p2=perl/modperl/trunk/t/conf/post_config_startup.pl&r2=111554 ============================================================================== --- perl/modperl/trunk/t/conf/post_config_startup.pl (original) +++ perl/modperl/trunk/t/conf/post_config_startup.pl Fri Dec 10 15:30:14 2004 @@ -27,6 +27,8 @@ warn "END in modperl_extra.pl, pid=$$\n"; } +test_apache_resource(); + test_apache_size_limit(); test_loglevel(); @@ -38,6 +40,22 @@ ### only subs below this line ### + +sub test_apache_resource { + ### Apache::Resource tests + + # load first for the menu + require Apache::Status; + + # uncomment for local tests + #$ENV{PERL_RLIMIT_DEFAULTS} = 1; + #$Apache::Resource::Debug = 1; + + # requires optional BSD::Resource + return unless eval { require BSD::Resource }; + + require Apache::Resource; +} sub test_apache_size_limit { require Apache::MPM;