You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by pg...@apache.org on 2006/08/26 09:20:59 UTC

svn commit: r437104 - in /perl/Apache-SizeLimit/trunk: lib/Apache2/SizeLimit.pm t/response/TestApache2/check_n_requests2.pm t/response/TestApache2/deprecated.pm

Author: pgollucci
Date: Sat Aug 26 00:20:53 2006
New Revision: 437104

URL: http://svn.apache.org/viewvc?rev=437104&view=rev
Log:
o Apache::Log is not needed
o note PerlOptions +GlobalRequest is needed to use the deprecated APIs in mod_perl 2.x
  Also, adjust the test suite toa ccount for this
o modify the way add_cleanup_handler() register's its $r->pool cleanup
  so using the new APIs doesn't require PerlOptions +GlobalRequest

server localhost:8529 started
t/apache/all......................skipped
        all skipped: apache version 1 required, this is version 2
t/apache2/basic...................ok                                         
t/apache2/check_n_requests2.......ok                                         
t/apache2/deprecated..............ok                                         
t/apache2/zzz_check_n_requests....ok                                         
t/pod.............................ok                                         
All tests successful, 1 test skipped.
Files=6, Tests=17,  6 wallclock secs ( 3.39 cusr +  0.93 csys =  4.32 CPU)



Modified:
    perl/Apache-SizeLimit/trunk/lib/Apache2/SizeLimit.pm
    perl/Apache-SizeLimit/trunk/t/response/TestApache2/check_n_requests2.pm
    perl/Apache-SizeLimit/trunk/t/response/TestApache2/deprecated.pm

Modified: perl/Apache-SizeLimit/trunk/lib/Apache2/SizeLimit.pm
URL: http://svn.apache.org/viewvc/perl/Apache-SizeLimit/trunk/lib/Apache2/SizeLimit.pm?rev=437104&r1=437103&r2=437104&view=diff
==============================================================================
--- perl/Apache-SizeLimit/trunk/lib/Apache2/SizeLimit.pm (original)
+++ perl/Apache-SizeLimit/trunk/lib/Apache2/SizeLimit.pm Sat Aug 26 00:20:53 2006
@@ -73,8 +73,8 @@
     # test it, since apparently it does not push a handler onto the
     # PerlCleanupHandler phase. That means that there's no way to use
     # $r->get_handlers() to check the results of calling this method.
-		# $r->get_handlers() SEGFAULTS at the moment in 2.x
-		$r->pool->cleanup_register(\&_exit_if_too_big, $r);
+    # $r->get_handlers() SEGFAULTS at the moment in 2.x
+    $r->pool->cleanup_register(sub { $class->_exit_if_too_big(shift) }, $r);
 
     $r->pnotes(size_limit_cleanup => 1);
 }
@@ -116,7 +116,10 @@
 
 {
     # Deprecated APIs
-
+    # If you use these, you must set
+    # PerlOptions +GlobalRequest -- we have no $r otherwise
+	# This is differs a from the mp1 series
+	
     sub setmax {
 
         my $class = __PACKAGE__;
@@ -485,7 +488,9 @@
 =back
 
 Besides setting the appropriate limit, these functions I<also> add a
-cleanup handler to the current request.
+cleanup handler to the current request.  In the 2.x series of mod_perl
+to use the deprecated functions, you must set PerlOptions +GlobalRequest
+accordingly.
 
 =head1 SUPPORT
 

Modified: perl/Apache-SizeLimit/trunk/t/response/TestApache2/check_n_requests2.pm
URL: http://svn.apache.org/viewvc/perl/Apache-SizeLimit/trunk/t/response/TestApache2/check_n_requests2.pm?rev=437104&r1=437103&r2=437104&view=diff
==============================================================================
--- perl/Apache-SizeLimit/trunk/t/response/TestApache2/check_n_requests2.pm (original)
+++ perl/Apache-SizeLimit/trunk/t/response/TestApache2/check_n_requests2.pm Sat Aug 26 00:20:53 2006
@@ -4,7 +4,6 @@
 use warnings;
 
 use Apache2::Const -compile => qw(OK);
-use Apache::Log;
 
 use Apache::Test qw(-withtestmore);
 
@@ -43,7 +42,7 @@
        "we passed the limits and will _NOT_ kill the child"
       );
 
-    return Apachei2::Const::OK;
+    return Apache2::Const::OK;
 }
 
 1;

Modified: perl/Apache-SizeLimit/trunk/t/response/TestApache2/deprecated.pm
URL: http://svn.apache.org/viewvc/perl/Apache-SizeLimit/trunk/t/response/TestApache2/deprecated.pm?rev=437104&r1=437103&r2=437104&view=diff
==============================================================================
--- perl/Apache-SizeLimit/trunk/t/response/TestApache2/deprecated.pm (original)
+++ perl/Apache-SizeLimit/trunk/t/response/TestApache2/deprecated.pm Sat Aug 26 00:20:53 2006
@@ -29,5 +29,13 @@
     return Apache2::Const::OK;
 }
 
-
 1;
+
+__DATA__
+<NoAutoConfig>
+    <Location /TestApache2__deprecated>
+        PerlOptions +GlobalRequest
+		    SetHandler modperl
+				PerlResponseHandler TestApache2::deprecated
+	  </Location>
+</NoAutoConfig>