Mercurial > hg > nginx-tests
comparison stream_error_log.t @ 565:ff49e1c00b35
Tests: in stream tests, try to read all the data where appropriate.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Wed, 29 Apr 2015 14:58:27 +0300 |
parents | abf5f3197967 |
children | 22bade4c7e12 |
comparison
equal
deleted
inserted
replaced
564:a1c93746570d | 565:ff49e1c00b35 |
---|---|
168 my ($data, $peer) = @_; | 168 my ($data, $peer) = @_; |
169 | 169 |
170 $peer = '127.0.0.1:8080' unless defined $peer; | 170 $peer = '127.0.0.1:8080' unless defined $peer; |
171 my $s = stream_connect($peer); | 171 my $s = stream_connect($peer); |
172 stream_write($s, $data); | 172 stream_write($s, $data); |
173 my $r = stream_read($s); | 173 |
174 | 174 $data = ''; |
175 $s->close; | 175 while (my $buf = stream_read($s)) { |
176 return $r; | 176 $data .= $buf; |
177 } | |
178 return $data; | |
177 } | 179 } |
178 | 180 |
179 sub stream_connect { | 181 sub stream_connect { |
180 my $peer = shift; | 182 my $peer = shift; |
181 my $s = IO::Socket::INET->new( | 183 my $s = IO::Socket::INET->new( |