Skip to content

Commit

Permalink
Avoid race condition of early handshake messages, when socket is acti…
Browse files Browse the repository at this point in the history
…ve mode is not false.
  • Loading branch information
dgud authored and Erlang/OTP committed Apr 16, 2010
1 parent f392892 commit 5eaee42
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ssl/src/ssl.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down

0 comments on commit 5eaee42

Please sign in to comment.