提交 44420615 编写于 作者: A Andy Polyakov

TLSProxy/Proxy.pm: straighten inner loop termination logic.

Original condition was susceptible to race condition...
Reviewed-by: NBernd Edlinger <bernd.edlinger@hotmail.de>
Reviewed-by: NRichard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5933)
上级 de5b3a86
......@@ -369,12 +369,14 @@ sub clientstart
$fdset = IO::Select->new($server_sock, $client_sock);
my @ready;
my $ctr = 0;
my $sessionfile = $self->{sessionfile};
local $SIG{PIPE} = "IGNORE";
while($fdset->count
&& (!(TLSProxy::Message->end)
|| (defined $self->sessionfile()
&& (-s $self->sessionfile()) == 0))
&& $ctr < 10) {
while($fdset->count && $ctr < 10) {
if (defined($sessionfile)) {
# s_client got -ign_eof and won't be exiting voluntarily, so we
# look for data *and* check on session file...
last if TLSProxy::Message->success() && -s $sessionfile;
}
if (!(@ready = $fdset->can_read(1))) {
$ctr++;
next;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册