diff options
author | Anders Svensson <[email protected]> | 2017-03-11 00:04:58 +0100 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2017-06-11 16:30:34 +0200 |
commit | 69b0c1878a95bdfcfe9043fbccf8a0f7b4545bdc (patch) | |
tree | 596dd8fecce8fdda118dd5104c5f029d6958b27f | |
parent | eb69b55b1f2a490f87e5f3f976fcd1351b82eafb (diff) | |
download | otp-69b0c1878a95bdfcfe9043fbccf8a0f7b4545bdc.tar.gz otp-69b0c1878a95bdfcfe9043fbccf8a0f7b4545bdc.tar.bz2 otp-69b0c1878a95bdfcfe9043fbccf8a0f7b4545bdc.zip |
Fix gen_tcp close of ssl socket
Should be ssl:close/1.
-rw-r--r-- | lib/diameter/src/transport/diameter_tcp.erl | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/diameter/src/transport/diameter_tcp.erl b/lib/diameter/src/transport/diameter_tcp.erl index 63642a8168..8e400bc6ee 100644 --- a/lib/diameter/src/transport/diameter_tcp.erl +++ b/lib/diameter/src/transport/diameter_tcp.erl @@ -72,6 +72,7 @@ %% Listener process state. -record(listener, {socket :: inet:socket(), + module :: module(), service = false :: false | pid()}). %% service process %% Monitor process state. @@ -250,7 +251,8 @@ i({listen, Ref, {Mod, Opts, Addrs}}) -> LAddr = laddr(LAddrOpt, Mod, LSock), true = diameter_reg:add_new({?MODULE, listener, {Ref, {LAddr, LSock}}}), proc_lib:init_ack({ok, self(), {LAddr, LSock}}), - #listener{socket = LSock}. + #listener{socket = LSock, + module = Mod}. laddr([], Mod, Sock) -> {ok, {Addr, _Port}} = sockname(Mod, Sock), @@ -520,13 +522,15 @@ m({'DOWN', _, process, Pid, _}, #monitor{parent = Pid, %% Service process has died. l({'DOWN', _, process, Pid, _} = T, #listener{service = Pid, - socket = Sock}) -> - gen_tcp:close(Sock), + socket = Sock, + module = M}) -> + M:close(Sock), x(T); %% Transport has been removed. -l({transport, remove, _} = T, #listener{socket = Sock}) -> - gen_tcp:close(Sock), +l({transport, remove, _} = T, #listener{socket = Sock, + module = M}) -> + M:close(Sock), x(T). %% t/2 |