httpd-apreq-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1067401 - /httpd/apreq/trunk/glue/perl/lib/APR/Request/Magic.pm
Date Sat, 05 Feb 2011 06:59:48 GMT
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;



Mime
View raw message