From: John Napiorkowski Date: Thu, 29 Oct 2015 14:54:21 +0000 (-0500) Subject: t push origin masterMerge branch 'billmoseley-check_return_of_write_to_psgi_input' X-Git-Tag: 5.90102~9 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=a0b5065e3dd43fea2ca17f4f2ae7cbe1958057d4;hp=d2995a765f120b78a134a6e8dfb14b0f7fde8644 t push origin masterMerge branch 'billmoseley-check_return_of_write_to_psgi_input' --- 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