From: Andy Grundman Date: Tue, 8 Nov 2005 13:41:46 +0000 (+0000) Subject: Fixed streaming write from a filehandle to stop writing if the browser is closed X-Git-Tag: 5.7099_04~998 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=6484fba0d3daff654c5f419bc91b6bf6229e188f Fixed streaming write from a filehandle to stop writing if the browser is closed --- diff --git a/Changes b/Changes index 70ce52e..3c705b2 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,8 @@ Tis file documents the revision history for Perl extension Catalyst. 5.5 + - Fixed streaming write from a filehandle to stop writing + if the browser is closed. - Added $c->controller, $c->model and $c->view shortcuts - Switched to Text::SimpleTable diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index 23df2a1..920fe0e 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -47,7 +47,7 @@ sub finalize_body { if ( ref $c->response->body && $c->response->body->can('read') ) { while ( !$c->response->body->eof() ) { $c->response->body->read( my $buffer, $CHUNKSIZE ); - $self->write( $c, $buffer ); + last unless $self->write( $c, $buffer ); } $c->response->body->close(); }