X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FEngine.pm;h=733e1eac9054c10958e282d4c34b06d8130022b4;hb=f6e054bb531b18cbe6c7826efdbf804a87e4858f;hp=16385dc33941d452d6ee69e1c9729418f9df867e;hpb=0822f9a43c8f0b885b240c177cc654ab835b3b14;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index 16385dc..733e1ea 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -388,6 +388,7 @@ Get an action in a given namespace. sub get_action { my ( $c, $action, $namespace ) = @_; + return [] unless $action; $namespace ||= ''; if ($namespace) { $namespace = '' if $namespace eq '/'; @@ -459,10 +460,13 @@ sub handler { for my $begin ( @{ $c->get_action( 'begin', $namespace ) } ) { $c->state( $c->execute( @{ $begin->[0] } ) ); } - for my $result ( @{ $c->get_action( $action, $default ) }[-1] ) - { - $c->state( $c->execute( @{ $result->[0] } ) ); - last unless $default; + if ( my $action = $c->req->action ) { + for my $result ( + @{ $c->get_action( $action, $default ) }[-1] ) + { + $c->state( $c->execute( @{ $result->[0] } ) ); + last unless $default; + } } for my $end ( reverse @{ $c->get_action( 'end', $namespace ) } ) { @@ -486,8 +490,8 @@ sub handler { my $av = sprintf '%.3f', 1 / $elapsed; my $t = Text::ASCIITable->new; $t->setCols( 'Action', 'Time' ); - $t->setColWidth( 'Action', 65, 1 ); - $t->setColWidth( 'Time', 8, 1 ); + $t->setColWidth( 'Action', 64, 1 ); + $t->setColWidth( 'Time', 9, 1 ); for my $stat (@stats) { $t->addRow(@$stat); @@ -534,9 +538,9 @@ sub prepare { if ( $c->debug ) { my $secs = time - $START || 1; my $av = sprintf '%.3f', $COUNT / $secs; - $c->log->debug('********************************'); + $c->log->debug('**********************************'); $c->log->debug("* Request $COUNT ($av/s) [$$]"); - $c->log->debug('********************************'); + $c->log->debug('**********************************'); $c->res->headers->header( 'X-Catalyst' => $Catalyst::VERSION ); } $c->prepare_request($r);