You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apreq-cvs@httpd.apache.org by jo...@apache.org on 2011/02/05 07:59:48 UTC
svn commit: r1067401 - /httpd/apreq/trunk/glue/perl/lib/APR/Request/Magic.pm
Author: joes
Date: Sat Feb 5 06:59:48 2011
New Revision: 1067401
URL: http://svn.apache.org/viewvc?rev=1067401&view=rev
Log:
memoize this
Modified:
httpd/apreq/trunk/glue/perl/lib/APR/Request/Magic.pm
Modified: httpd/apreq/trunk/glue/perl/lib/APR/Request/Magic.pm
URL: http://svn.apache.org/viewvc/httpd/apreq/trunk/glue/perl/lib/APR/Request/Magic.pm?rev=1067401&r1=1067400&r2=1067401&view=diff
==============================================================================
--- httpd/apreq/trunk/glue/perl/lib/APR/Request/Magic.pm (original)
+++ httpd/apreq/trunk/glue/perl/lib/APR/Request/Magic.pm Sat Feb 5 06:59:48 2011
@@ -1,12 +1,13 @@
package APR::Request::Magic;
require base;
+my $ctx;
eval { local $ENV{PERL_DL_NONLAZY} = 1; require APR::Request::Apache2; };
if ($@) {
require APR::Request::CGI;
require APR::Pool;
base->import("APR::Pool");
*handle = sub { APR::Request::CGI->handle(@_) };
- *new = sub { bless APR::Pool->new, shift };
+ *new = sub { $ctx ||= bless APR::Pool->new, shift; return $ctx };
}
else {
require Apache2::RequestRec;