You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "Philip M. Gollucci" <pg...@p6m7g8.com> on 2006/08/26 09:36:54 UTC

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

Anyone wanting to take mp1 and mp2 variants for a test spin -- very appreciated.

Thanks.


-------- Original Message --------
Subject: svn commit: r437104 -
Date: Sat, 26 Aug 2006 07:20:59 -0000
To: modperl-cvs@perl.apache.org
From: pgollucci@apache.org
Message-Id: <20...@eris.apache.org>

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>


-- 
------------------------------------------------------------------------
Philip M. Gollucci (pgollucci@p6m7g8.com) 323.219.4708
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - TicketMaster - http://ticketmaster.com
1024D/A79997FA F357 0FDD 2301 6296 690F  6A47 D55A 7172 A799 97F

"In all that I've done wrong I know I must have done something right to
deserve a hug every morning and butterfly kisses at night."
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /
 / /|_/ / // /\ \/ /_/ / /__
/_/  /_/\_, /___/\___\_\___/
       <___/

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

Posted by "Philip M. Gollucci" <pg...@p6m7g8.com>.
Fred Moyer wrote:
> On Sat, 26 Aug 2006, Philip M. Gollucci wrote:
> 
>> Anyone wanting to take mp1 and mp2 variants for a test spin -- very
>> appreciated.
> 
> So far the tests are passing for me except for the ones which require
> A::T 1.29 - 1.28 was the latest last time I looked no?
Its still the latest.  1.29 is -dev.


-- 
------------------------------------------------------------------------
Philip M. Gollucci (pgollucci@p6m7g8.com) 323.219.4708
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - TicketMaster - http://ticketmaster.com
1024D/A79997FA F357 0FDD 2301 6296 690F  6A47 D55A 7172 A799 97F

"In all that I've done wrong I know I must have done something right to
deserve a hug every morning and butterfly kisses at night."
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /
 / /|_/ / // /\ \/ /_/ / /__
/_/  /_/\_, /___/\___\_\___/
       <___/

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

Posted by Fred Moyer <fr...@taperfriendlymusic.org>.
On Sat, 26 Aug 2006, Philip M. Gollucci wrote:

> Anyone wanting to take mp1 and mp2 variants for a test spin -- very appreciated.

So far the tests are passing for me except for the ones which require A::T 
1.29 - 1.28 was the latest last time I looked no?

>
> Thanks.
>
>
> -------- Original Message --------
> Subject: svn commit: r437104 -
> Date: Sat, 26 Aug 2006 07:20:59 -0000
> To: modperl-cvs@perl.apache.org
> From: pgollucci@apache.org
> Message-Id: <20...@eris.apache.org>
>
> 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>
>
>
> -- 
> ------------------------------------------------------------------------
> Philip M. Gollucci (pgollucci@p6m7g8.com) 323.219.4708
> Consultant / http://p6m7g8.net/Resume/resume.shtml
> Senior Software Engineer - TicketMaster - http://ticketmaster.com
> 1024D/A79997FA F357 0FDD 2301 6296 690F  6A47 D55A 7172 A799 97F
>
> "In all that I've done wrong I know I must have done something right to
> deserve a hug every morning and butterfly kisses at night."
>   __  ___     ___ ____  __
>  /  |/  /_ __/ __/ __ \/ /
> / /|_/ / // /\ \/ /_/ / /__
> /_/  /_/\_, /___/\___\_\___/
>       <___/
>