diff options
author | Matt Caswell <matt@openssl.org> | 2017-08-31 09:39:26 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2017-09-01 08:47:14 +0100 |
commit | 4130016623d043c7279f39937a73c24200288a73 (patch) | |
tree | 00f494cfa719c44b430fd95f701db972fc4397cd /util | |
parent | 6e5a853bda24e8aece325ecf5aa68b8ea832e414 (diff) |
Fix Proxy where a timeout occurs waiting for both client and server
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4305)
Diffstat (limited to 'util')
-rw-r--r-- | util/perl/TLSProxy/Proxy.pm | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/util/perl/TLSProxy/Proxy.pm b/util/perl/TLSProxy/Proxy.pm index c92652e78f..f3e76bf35c 100644 --- a/util/perl/TLSProxy/Proxy.pm +++ b/util/perl/TLSProxy/Proxy.pm @@ -297,8 +297,11 @@ sub clientstart while( (!(TLSProxy::Message->end) || (defined $self->sessionfile() && (-s $self->sessionfile()) == 0)) - && $ctr < 10 - && (@ready = $sel->can_read(1))) { + && $ctr < 10) { + if (!(@ready = $sel->can_read(1))) { + $ctr++; + next; + } foreach my $hand (@ready) { if ($hand == $server_sock) { $server_sock->sysread($indata, 16384) or goto END; @@ -311,7 +314,7 @@ sub clientstart $server_sock->syswrite($indata); $ctr = 0; } else { - $ctr++ + die "Unexpected handle"; } } } |