X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FRequest.pm;h=523c3f2169f8452db794d3359e1a0cf0e7b4a0b6;hp=53f93378e3485708a6029665e12108da039e56ec;hb=eb1f418b9ee46e9d6a10a0858a7da72ca0343760;hpb=80ba671f681862620befead95d299c8dfc91cbaf diff --git a/lib/Catalyst/Request.pm b/lib/Catalyst/Request.pm index 53f9337..523c3f2 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