提交 e02d5886 编写于 作者: R Richard Levitte

TLSProxy::Proxy: Don't use ReuseAddr on Windows

On Windows, we sometimes see a behavior with SO_REUSEADDR where there
remains lingering listening sockets on the same address and port as a
newly created one.

An easy solution is not to use ReuseAddr on Windows.

Thanks Bernd Edlinger for the suggestion.
Reviewed-by: NBernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/5103)
上级 9db6673e
......@@ -189,13 +189,15 @@ sub clientstart
# Create the Proxy socket
my $proxaddr = $self->proxy_addr;
$proxaddr =~ s/[\[\]]//g; # Remove [ and ]
my $proxy_sock = $IP_factory->(
my @proxyargs = (
LocalHost => $proxaddr,
LocalPort => $self->proxy_port,
Proto => "tcp",
Listen => SOMAXCONN,
ReuseAddr => 1
);
);
push @proxyargs, ReuseAddr => 1
unless $^O eq "MSWin32";
my $proxy_sock = $IP_factory->(@proxyargs);
if ($proxy_sock) {
print "Proxy started on port ".$self->proxy_port."\n";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册