From 8f38e5903f908357a10968f4260162cf4a09bf80 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Sat, 17 Apr 2010 08:20:46 +0000 Subject: Reset inet options Temporary set the inet options on listen socket before doing accept so that the correct options will be inherited by the accept socket. Reset the options afterwards so that repeated use of listen socket get user set values. --- lib/ssl/src/ssl.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl index 0a9e216ca5..3cd4c7fdbd 100644 --- a/lib/ssl/src/ssl.erl +++ b/lib/ssl/src/ssl.erl @@ -153,10 +153,11 @@ transport_accept(#sslsocket{pid = {ListenSocket, #config{cb=CbInfo, ssl=SslOpts} %% and options should be inherited. EmOptions = emulated_options(), {ok, InetValues} = inet:getopts(ListenSocket, EmOptions), - inet:setopts(ListenSocket, internal_inet_values()), + ok = inet:setopts(ListenSocket, internal_inet_values()), {CbModule,_,_} = CbInfo, case CbModule:accept(ListenSocket, Timeout) of {ok, Socket} -> + ok = inet:setopts(ListenSocket, InetValues), {ok, Port} = inet:port(Socket), ConnArgs = [server, "localhost", Port, Socket, {SslOpts, socket_options(InetValues)}, self(), CbInfo], -- cgit v1.2.3