Fixed streaming write from a filehandle to stop writing if the browser is closed
Andy Grundman [Tue, 8 Nov 2005 13:41:46 +0000 (13:41 +0000)]
Changes
lib/Catalyst/Engine.pm

diff --git a/Changes b/Changes
index 70ce52e..3c705b2 100644 (file)
--- 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
 
index 23df2a1..920fe0e 100644 (file)
@@ -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();
     }