From 5eaee4202e77086422317f3c24f719a52491ecc7 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Fri, 16 Apr 2010 07:20:49 +0000 Subject: Avoid race condition of early handshake messages, when socket is active mode is not false. --- lib/ssl/src/ssl.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl index fd9ed4a344..0a9e216ca5 100644 --- a/lib/ssl/src/ssl.erl +++ b/lib/ssl/src/ssl.erl @@ -153,10 +153,10 @@ transport_accept(#sslsocket{pid = {ListenSocket, #config{cb=CbInfo, ssl=SslOpts} %% and options should be inherited. EmOptions = emulated_options(), {ok, InetValues} = inet:getopts(ListenSocket, EmOptions), - {CbModule,_,_} = CbInfo, + inet:setopts(ListenSocket, internal_inet_values()), + {CbModule,_,_} = CbInfo, case CbModule:accept(ListenSocket, Timeout) of {ok, Socket} -> - inet:setopts(Socket, internal_inet_values()), {ok, Port} = inet:port(Socket), ConnArgs = [server, "localhost", Port, Socket, {SslOpts, socket_options(InetValues)}, self(), CbInfo], -- cgit v1.2.3