changeset 1508:1a409a166420

Tests: fixed http_keepalive.t with short reads and double logging.
author Sergey Kandaurov <pluknet@nginx.com>
date Mon, 16 Sep 2019 19:00:29 +0300
parents 8958b5b53c25
children 1603f2bad385
files http_keepalive.t
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/http_keepalive.t	Mon Sep 09 17:51:47 2019 +0300
+++ b/http_keepalive.t	Mon Sep 16 19:00:29 2019 +0300
@@ -108,7 +108,7 @@
 
 sub http_keepalive {
 	my ($url, %opts) = @_;
-	my $data = '';
+	my $total = '';
 
 	$opts{ua} = $opts{ua} || '';
 	$opts{req} = $opts{req} || 1;
@@ -130,6 +130,8 @@
 
 EOF
 
+		my $data = '';
+
 		while (IO::Select->new($s)->can_read(3)) {
 			sysread($s, my $buffer, 4096) or last;
 			$data .= $buffer;
@@ -137,9 +139,11 @@
 		}
 
 		log_in($data);
+
+		$total .= $data;
 	}
 
-	return $data;
+	return $total;
 }
 
 sub count_keepalive {