Mercurial > hg > nginx-tests
changeset 805:b8db75ef1f00
Tests: stream_upstream_least_conn.t cleanup.
No functional changes.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Mon, 14 Dec 2015 16:19:08 +0300 |
parents | 6b2512f859a0 |
children | ffdd33c64193 |
files | stream_upstream_least_conn.t |
diffstat | 1 files changed, 0 insertions(+), 25 deletions(-) [+] |
line wrap: on
line diff
--- a/stream_upstream_least_conn.t Wed Dec 09 19:16:25 2015 +0300 +++ b/stream_upstream_least_conn.t Mon Dec 14 16:19:08 2015 +0300 @@ -89,31 +89,6 @@ return join ', ', map { $_ . ": " . $ports{$_} } sort keys %ports; } -sub parallel { - my ($data, $count, %opts) = @_; - my (@sockets, %ports, $peer); - - $peer = $opts{peer} || undef; - - for (1 .. $count) { - my $s = stream_connect($peer); - push @sockets, $s; - stream_write($s, $data); - select undef, undef, undef, 0.2; - } - - for (1 .. $count) { - my $s = pop @sockets; - if (stream_read($s) =~ /(\d+)/) { - $ports{$1} = 0 unless defined $ports{$1}; - $ports{$1}++; - } - close $s; - } - - return join ', ', map { $_ . ": " . $ports{$_} } sort keys %ports; -} - sub stream_get { my ($data, $peer) = @_;