Do what we want instead of exiting a sub via last.
Florian Ragwitz [Fri, 21 Aug 2009 21:22:36 +0000 (21:22 +0000)]
lib/Catalyst/Engine.pm

index 9190d9a..32cac01 100644 (file)
@@ -51,7 +51,7 @@ sub finalize_body {
         my $got;
         do {
             $got = read $body, my ($buffer), $CHUNKSIZE;
-            last unless $self->write( $c, $buffer );
+            $got = 0 unless $self->write( $c, $buffer );
         } while $got > 0;
 
         close $body;