X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FEngine%2FHTTP.pm;h=85ab25f9a227144631b602c06adc962eba87f931;hp=fcb36b414259c3d5dc58e1398f790fdf7f46f0c2;hb=059c085bfcead450e70ace9ef193aa99ac2ab37d;hpb=25f55123b7c0b520eb166890bf47f1f3217200af diff --git a/lib/Catalyst/Engine/HTTP.pm b/lib/Catalyst/Engine/HTTP.pm index fcb36b4..85ab25f 100644 --- a/lib/Catalyst/Engine/HTTP.pm +++ b/lib/Catalyst/Engine/HTTP.pm @@ -263,14 +263,15 @@ sub run { if ( !$self->_read_headers ) { # Error reading, give up + close Remote; next LISTEN; } my ( $method, $uri, $protocol ) = $self->_parse_request_line; + + next unless $method; DEBUG && warn "Parsed request: $method $uri $protocol\n"; - - next unless $method; unless ( uc($method) eq 'RESTART' ) { @@ -419,9 +420,14 @@ sub _read_headers { while (1) { my $read = sysread Remote, my $buf, CHUNKSIZE; - - if ( !$read ) { - DEBUG && warn "EOF or error: $!\n"; + + if ( !defined $read ) { + next if $! == EWOULDBLOCK; + DEBUG && warn "Error reading headers: $!\n"; + return; + } + elsif ( $read == 0 ) { + DEBUG && warn "EOF\n"; return; }