aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2010-04-17 08:20:46 +0000
committerErlang/OTP <[email protected]>2010-04-17 08:20:46 +0000
commit8f38e5903f908357a10968f4260162cf4a09bf80 (patch)
tree6c33626fd985c2e94249f7f62f831f1073919563
parent5eaee4202e77086422317f3c24f719a52491ecc7 (diff)
downloadotp-8f38e5903f908357a10968f4260162cf4a09bf80.tar.gz
otp-8f38e5903f908357a10968f4260162cf4a09bf80.tar.bz2
otp-8f38e5903f908357a10968f4260162cf4a09bf80.zip
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.
-rw-r--r--lib/ssl/src/ssl.erl3
1 files changed, 2 insertions, 1 deletions
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],