perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r109558 - /perl/modperl/trunk/Changes /perl/modperl/trunk/t/conf/modperl_extra.pl /perl/modperl/trunk/t/response/TestAPI/server_util.pm /perl/modperl/trunk/xs/Apache/ServerUtil/Apache__ServerUtil.h /perl/modperl/trunk/xs/maps/modperl_functions.map
Date Thu, 02 Dec 2004 21:49:19 GMT
Author: stas
Date: Thu Dec  2 13:49:17 2004
New Revision: 109558

URL: http://svn.apache.org/viewcvs?view=rev&rev=109558
Log:
provide perl glue for the mod_perl's base_server_pool
via Apache::ServerUtil::base_server_pool()

Modified:
   perl/modperl/trunk/Changes
   perl/modperl/trunk/t/conf/modperl_extra.pl
   perl/modperl/trunk/t/response/TestAPI/server_util.pm
   perl/modperl/trunk/xs/Apache/ServerUtil/Apache__ServerUtil.h
   perl/modperl/trunk/xs/maps/modperl_functions.map

Modified: perl/modperl/trunk/Changes
Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/Changes?view=diff&rev=109558&p1=perl/modperl/trunk/Changes&r1=109557&p2=perl/modperl/trunk/Changes&r2=109558
==============================================================================
--- perl/modperl/trunk/Changes	(original)
+++ perl/modperl/trunk/Changes	Thu Dec  2 13:49:17 2004
@@ -12,6 +12,9 @@
 
 =item 1.99_18-dev
 
+provide perl glue for the mod_perl's base_server_pool
+via Apache::ServerUtil::base_server_pool() [Geoff, Stas]
+
 Apache::Resource ported to mp2 [Stas]
 
 If none of MP_APXS, MP_AP_PREFIX and MP_USE_STATIC were specified when

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=109558&p1=perl/modperl/trunk/t/conf/modperl_extra.pl&r1=109557&p2=perl/modperl/trunk/t/conf/modperl_extra.pl&r2=109558
==============================================================================
--- perl/modperl/trunk/t/conf/modperl_extra.pl	(original)
+++ perl/modperl/trunk/t/conf/modperl_extra.pl	Thu Dec  2 13:49:17 2004
@@ -51,6 +51,8 @@
 
 test_perl_ithreads();
 
+test_base_server_pool();
+
 
 
 ### only subs below this line ###
@@ -196,6 +198,22 @@
         eval { require threads; "threads"->import() };
     }
 }
+
+sub test_base_server_pool {
+    # we can't really test the functionality since it happens at
+    # server shutdown, when the test suite has finished its run
+    # so just check that we can register the cleanup and that it
+    # doesn't segfault
+    my $base_server_pool = Apache::ServerUtil::base_server_pool();
+    $base_server_pool->cleanup_register(sub { Apache::OK });
+    # replace the sub with the following to get some visual debug
+    # should log the date twice (once on -start, once more on -stop)
+    # sub { local %ENV; qx[/bin/date >> /tmp/date]; Apache::OK; }
+    #
+    # also remember that cleanup_register() called on this pool will
+    # work only when registered at the server startup
+}
+
 
 sub ModPerl::Test::add_config {
     my $r = shift;

Modified: perl/modperl/trunk/t/response/TestAPI/server_util.pm
Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/response/TestAPI/server_util.pm?view=diff&rev=109558&p1=perl/modperl/trunk/t/response/TestAPI/server_util.pm&r1=109557&p2=perl/modperl/trunk/t/response/TestAPI/server_util.pm&r2=109558
==============================================================================
--- perl/modperl/trunk/t/response/TestAPI/server_util.pm	(original)
+++ perl/modperl/trunk/t/response/TestAPI/server_util.pm	Thu Dec  2 13:49:17 2004
@@ -29,7 +29,7 @@
 sub handler {
     my $r = shift;
 
-    plan $r, tests => 15;
+    plan $r, tests => 17;
 
     {
         my $s = $r->server;
@@ -47,6 +47,14 @@
     ok $r->server->method_register('FOO');
 
     server_root_relative_tests($r);
+
+    my $base_server_pool = Apache::ServerUtil::base_server_pool();
+    ok $base_server_pool->isa('APR::Pool');
+
+    # this will never run since it's not registered in the parent
+    # process
+    $base_server_pool->cleanup_register(sub { Apache::OK });
+    ok 1;
 
     Apache::OK;
 }

Modified: perl/modperl/trunk/xs/Apache/ServerUtil/Apache__ServerUtil.h
Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/xs/Apache/ServerUtil/Apache__ServerUtil.h?view=diff&rev=109558&p1=perl/modperl/trunk/xs/Apache/ServerUtil/Apache__ServerUtil.h&r1=109557&p2=perl/modperl/trunk/xs/Apache/ServerUtil/Apache__ServerUtil.h&r2=109558
==============================================================================
--- perl/modperl/trunk/xs/Apache/ServerUtil/Apache__ServerUtil.h	(original)
+++ perl/modperl/trunk/xs/Apache/ServerUtil/Apache__ServerUtil.h	Thu Dec  2 13:49:17 2004
@@ -13,6 +13,8 @@
  * limitations under the License.
  */
 
+#define mpxs_Apache__ServerUtil_base_server_pool modperl_server_pool
+
 #define mpxs_Apache__ServerRec_method_register(s, methname)    \
     ap_method_register(s->process->pconf, methname);
 

Modified: perl/modperl/trunk/xs/maps/modperl_functions.map
Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/xs/maps/modperl_functions.map?view=diff&rev=109558&p1=perl/modperl/trunk/xs/maps/modperl_functions.map&r1=109557&p2=perl/modperl/trunk/xs/maps/modperl_functions.map&r2=109558
==============================================================================
--- perl/modperl/trunk/xs/maps/modperl_functions.map	(original)
+++ perl/modperl/trunk/xs/maps/modperl_functions.map	Thu Dec  2 13:49:17 2004
@@ -81,6 +81,7 @@
 
 MODULE=Apache::ServerUtil PACKAGE=Apache::ServerUtil
  mpxs_Apache__ServerUtil_server_root_relative | | p, fname=""
+ apr_pool_t:DEFINE_base_server_pool
 
 PACKAGE=Apache
  server_rec *:DEFINE_server | | SV *:classname=Nullsv

Mime
View raw message