--- HTTP.pm.original 2008-04-02 14:09:38.842235024 +0200 +++ HTTP.pm 2008-04-02 15:58:30.817543488 +0200 @@ -258,6 +258,7 @@ if ( !$self->_read_headers ) { # Error reading, give up + close Remote; next LISTEN; } @@ -408,9 +409,15 @@ while (1) { my $read = sysread Remote, my $buf, CHUNKSIZE; - - if ( !$read ) { - DEBUG && warn "EOF or error: $!\n"; + if ( ! defined $read ) { + if ($! == EWOULDBLOCK) { + DEBUG && warn "EWOULDBLOCK\n"; + next; + } + DEBUG && warn "error: $!\n"; + return; + } elsif ( $read == 0 ) { + DEBUG && warn "EOF\n"; return; }