# HG changeset patch # User Sergey Kandaurov # Date 1492693430 -10800 # Node ID 2b8523bd4988b3c5eb98fe77285f3db61410fb5a # Parent ba26845f53ff84bc335e4205bf264d9d0978702e Tests: handled broken connections in http_keepalive.t. diff --git a/http_keepalive.t b/http_keepalive.t --- a/http_keepalive.t +++ b/http_keepalive.t @@ -115,6 +115,8 @@ sub http_keepalive { $opts{sleep} = $opts{sleep} || 0; $opts{method} = $opts{method} || 'GET'; + local $SIG{PIPE} = 'IGNORE'; + my $s = http('', start => 1); for my $i (1 .. $opts{req}) { @@ -129,7 +131,7 @@ User-Agent: $opts{ua} EOF while (IO::Select->new($s)->can_read(3)) { - sysread($s, my $buffer, 4096); + sysread($s, my $buffer, 4096) or last; $data .= $buffer; last if $data =~ /^\x0d\x0a/ms; }