Mercurial > hg > nginx-tests
changeset 1166:2b8523bd4988
Tests: handled broken connections in http_keepalive.t.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Thu, 20 Apr 2017 16:03:50 +0300 |
parents | ba26845f53ff |
children | 1e79a9613813 |
files | http_keepalive.t |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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; }