From: Andy Grundman Date: Wed, 22 Aug 2007 16:32:49 +0000 (+0000) Subject: Fixed bug in HTTP engine where writes could fail with 'Resource temporarily unavailable' X-Git-Tag: 5.7099_04~146 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=4d4d6635ada968ed67e4e82a6469f2843231a828 Fixed bug in HTTP engine where writes could fail with 'Resource temporarily unavailable' --- diff --git a/Changes b/Changes index 7912807..76d7dac 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,9 @@ e This file documents the revision history for Perl extension Catalyst. +5.7011 + - Fixed bug in HTTP engine where writes could fail with + 'Resource temporarily unavailable'. + 5.7010 2007-08-22 07:41:00 - Resource forks in 5.7009 diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 09ef82a..06bcf09 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -63,7 +63,7 @@ __PACKAGE__->response_class('Catalyst::Response'); # Remember to update this in Catalyst::Runtime as well! -our $VERSION = '5.7010'; +our $VERSION = '5.7011'; sub import { my ( $class, @arguments ) = @_; diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index 347f781..c53bc12 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -625,6 +625,11 @@ sub write { my $len = length($buffer); my $wrote = syswrite STDOUT, $buffer; + if ( !defined $wrote && $! == EWOULDBLOCK ) { + # Unable to write on the first try, will retry in the loop below + $wrote = 0; + } + if ( defined $wrote && $wrote < $len ) { # We didn't write the whole buffer while (1) { diff --git a/lib/Catalyst/Runtime.pm b/lib/Catalyst/Runtime.pm index e04ed9e..73d7079 100644 --- a/lib/Catalyst/Runtime.pm +++ b/lib/Catalyst/Runtime.pm @@ -7,7 +7,7 @@ BEGIN { require 5.008001; } # Remember to update this in Catalyst as well! -our $VERSION='5.7010'; +our $VERSION='5.7011'; =head1 NAME