From: John Napiorkowski Date: Thu, 29 Oct 2015 14:58:03 +0000 (-0500) Subject: Merge branch 'warn-on-uri-for' of https://github.com/melmothx/catalyst-runtime into... X-Git-Tag: 5.90102~8^2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=132a6d5088c10fe860437269286030074bff2de7;hp=7064f69b1dfb59d1f3bad647b2097d0320acce8a Merge branch 'warn-on-uri-for' of https://github.com/melmothx/catalyst-runtime into melmothx-warn-on-uri-for --- diff --git a/Changes b/Changes index 4d86d01..d785ab8 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,8 @@ # This file documents the revision history for Perl extension Catalyst. +5.90102 - 2015-10-29 + - Better warnings when there's an error reading the psgi.input + - 5.90101 - 2015-09-04 - Fixed a regression introduced in the last release which caused test case failure when using a version of Perl 5.14 or older. diff --git a/lib/Catalyst/Request.pm b/lib/Catalyst/Request.pm index 3bcc6c2..1306b94 100644 --- a/lib/Catalyst/Request.pm +++ b/lib/Catalyst/Request.pm @@ -293,7 +293,10 @@ sub prepare_body { # Check for definedness as you could read '0' while ( defined ( my $chunk = $self->read() ) ) { $self->prepare_body_chunk($chunk); - $stream_buffer->print($chunk) if $stream_buffer; + next unless $stream_buffer; + + $stream_buffer->print($chunk) + || die sprintf "Failed to write %d bytes to psgi.input file: $!", length( $chunk ); } # Ok, we read the body. Lets play nice for any PSGI app down the pipe