Skip to content

Commit

Permalink
Fix Proxy where a timeout occurs waiting for both client and server
Browse files Browse the repository at this point in the history
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from #4305)
  • Loading branch information
mattcaswell committed Sep 1, 2017
1 parent 6e5a853 commit 4130016
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions util/perl/TLSProxy/Proxy.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -311,7 +314,7 @@ sub clientstart
$server_sock->syswrite($indata);
$ctr = 0;
} else {
$ctr++
die "Unexpected handle";
}
}
}
Expand Down

0 comments on commit 4130016

Please sign in to comment.