X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FEngine.pm;h=443975ed05704b2fd544a80ddb8f0f1584a94f14;hb=81e2964aaa2c62ad7a5eb3be4d1b436265e17038;hp=4271aae2e4053c05ccc0a23ce7e20974b4afd47e;hpb=be1c95030e15ef9d081808462688ec09f7daed99;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index 4271aae..443975e 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -50,8 +50,8 @@ sub finalize_body { if ( blessed($body) && $body->can('read') or ref($body) eq 'GLOB' ) { my $got; do { - read $body, my ($buffer), $CHUNKSIZE; - last unless $self->write( $c, $buffer ); + $got = read $body, my ($buffer), $CHUNKSIZE; + $got = 0 unless $self->write( $c, $buffer ); } while $got > 0; close $body; @@ -112,7 +112,7 @@ sub finalize_error { my ( $self, $c ) = @_; $c->res->content_type('text/html; charset=utf-8'); - my $name = $c->config->{name} || join(' ', split('::', ref $c)); + my $name = ref($c)->config->{name} || join(' ', split('::', ref $c)); my ( $title, $error, $infos ); if ( $c->debug ) { @@ -317,13 +317,14 @@ sets up the L object body using L sub prepare_body { my ( $self, $c ) = @_; + my $appclass = ref($c) || $c; if ( my $length = $self->read_length ) { my $request = $c->request; unless ( $request->_body ) { my $type = $request->header('Content-Type'); $request->_body(HTTP::Body->new( $type, $length )); - $request->_body->tmpdir( $c->config->{uploadtmp} ) - if exists $c->config->{uploadtmp}; + $request->_body->tmpdir( $appclass->config->{uploadtmp} ) + if exists $appclass->config->{uploadtmp}; } while ( my $buffer = $self->read($c) ) {