X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FEngine.pm;h=095c4ffe567372b332dc4618748101006d9fc5f6;hp=7b8fe9109b89948e2a118346fbca4b3a60cf208b;hb=6e692ab40044cb1913d68d56196ce2c9dee45c9c;hpb=f4a57de40a851a87a5c9513fd8cb55dbd6cec12c diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index 7b8fe91..095c4ff 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -45,14 +45,14 @@ Finalize body. Prints the response output. sub finalize_body { my ( $self, $c ) = @_; if ( ref $c->response->body && $c->response->body->can('read') ) { - my $buffer; while ( !$c->response->body->eof() ) { - $c->response->body->read( $buffer, $CHUNKSIZE ); + $c->response->body->read( my $buffer, $CHUNKSIZE ); $self->write( $c, $buffer ); } + $c->response->body->close(); } else { - $self->write( $c, $c->response->output ); + $self->write( $c, $c->response->body ); } }