# HG changeset patch # User Sergey Kandaurov # Date 1568649629 -10800 # Node ID 1a409a166420aee398a5e954776d95738028c482 # Parent 8958b5b53c25aa1dffa0f6cfb4a42f4e0e4cc939 Tests: fixed http_keepalive.t with short reads and double logging. diff --git a/http_keepalive.t b/http_keepalive.t --- a/http_keepalive.t +++ b/http_keepalive.t @@ -108,7 +108,7 @@ like(http_keepalive('/zero'), qr/Connect sub http_keepalive { my ($url, %opts) = @_; - my $data = ''; + my $total = ''; $opts{ua} = $opts{ua} || ''; $opts{req} = $opts{req} || 1; @@ -130,6 +130,8 @@ User-Agent: $opts{ua} EOF + my $data = ''; + while (IO::Select->new($s)->can_read(3)) { sysread($s, my $buffer, 4096) or last; $data .= $buffer; @@ -137,9 +139,11 @@ EOF } log_in($data); + + $total .= $data; } - return $data; + return $total; } sub count_keepalive {