[Catalyst-commits] r13748 - in Catalyst-Runtime/5.80/branches/psgi/lib: . Catalyst

rafl at dev.catalyst.perl.org rafl at dev.catalyst.perl.org
Fri Dec 3 16:00:19 GMT 2010


Author: rafl
Date: 2010-12-03 16:00:19 +0000 (Fri, 03 Dec 2010)
New Revision: 13748

Modified:
   Catalyst-Runtime/5.80/branches/psgi/lib/Catalyst.pm
   Catalyst-Runtime/5.80/branches/psgi/lib/Catalyst/Engine.pm
Log:
Don't build the psgi app twice

Modified: Catalyst-Runtime/5.80/branches/psgi/lib/Catalyst/Engine.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/psgi/lib/Catalyst/Engine.pm	2010-12-03 12:30:23 UTC (rev 13747)
+++ Catalyst-Runtime/5.80/branches/psgi/lib/Catalyst/Engine.pm	2010-12-03 16:00:19 UTC (rev 13748)
@@ -780,13 +780,12 @@
 =cut
 
 sub run {
-    my ($self, $app, @args) = @_;
+    my ($self, $app, $psgi, @args) = @_;
+    # FIXME - Do something sensible with the options we're passed
     my $server = pop @args if blessed $args[-1];
     $server ||= Plack::Loader->auto(); # We're not being called from a script,
                                        # so auto detect what backend to run on.
                                        # This does *NOT* cover mod_perl.
-    # FIXME - Do something sensible with the options we're passed
-    my $psgi = $self->build_psgi_app($app, @args);
     $server->run($psgi);
 }
 
@@ -812,12 +811,12 @@
 
     $psgi_app = Plack::Middleware::Conditional->wrap(
         $psgi_app,
+        builder   => sub { Plack::Middleware::ReverseProxy->wrap($_[0]) },
         condition => sub {
             my ($env) = @_;
             return if $app->config->{ignore_frontend_proxy};
             return $env->{REMOTE_ADDR} eq '127.0.0.1' || $app->config->{using_frontend_proxy};
         },
-        builder   => sub { Plack::Middleware::ReverseProxy->wrap($_[0]) },
     );
 
     return $psgi_app;

Modified: Catalyst-Runtime/5.80/branches/psgi/lib/Catalyst.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/psgi/lib/Catalyst.pm	2010-12-03 12:30:23 UTC (rev 13747)
+++ Catalyst-Runtime/5.80/branches/psgi/lib/Catalyst.pm	2010-12-03 16:00:19 UTC (rev 13748)
@@ -2402,7 +2402,7 @@
 
 =cut
 
-sub run { my $c = shift; return $c->engine->run( $c, @_ ) }
+sub run { my $c = shift; return $c->engine->run( $c, $c->psgi_app, @_ ) }
 
 =head2 $c->set_action( $action, $code, $namespace, $attrs )
 




More information about the Catalyst-commits mailing list