X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FEngine.pm;h=f0758907cf9fd87f47bdb99344585e97e5815d82;hb=908e3d9e7a61974b3807b7ab37862550452b2456;hp=ce90738e81671ec7bf3debb8e5c8d42722aaf376;hpb=2832cb5d6e0c019910584d076ee6633afaeecfe1;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index ce90738..f075890 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -41,7 +41,8 @@ Finalize body. Prints the response output. sub finalize_body { my ( $self, $c ) = @_; my $body = $c->response->body; - if ( ref $body && ( $body->can('read') || ref($body) eq 'GLOB' ) ) { + no warnings 'uninitialized'; + if ( Scalar::Util::blessed($body) && $body->can('read') or ref($body) eq 'GLOB' ) { while ( !eof $body ) { read $body, my ($buffer), $CHUNKSIZE; last unless $self->write( $c, $buffer ); @@ -578,6 +579,8 @@ sub write { $self->prepare_write($c); $self->{_prepared_write} = 1; } + + return unless *STDOUT->opened(); print STDOUT $buffer; }