aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/src/transport/diameter_tcp.erl
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2017-03-11 00:04:58 +0100
committerAnders Svensson <[email protected]>2017-06-11 16:30:34 +0200
commit69b0c1878a95bdfcfe9043fbccf8a0f7b4545bdc (patch)
tree596dd8fecce8fdda118dd5104c5f029d6958b27f /lib/diameter/src/transport/diameter_tcp.erl
parenteb69b55b1f2a490f87e5f3f976fcd1351b82eafb (diff)
downloadotp-69b0c1878a95bdfcfe9043fbccf8a0f7b4545bdc.tar.gz
otp-69b0c1878a95bdfcfe9043fbccf8a0f7b4545bdc.tar.bz2
otp-69b0c1878a95bdfcfe9043fbccf8a0f7b4545bdc.zip
Fix gen_tcp close of ssl socket
Should be ssl:close/1.
Diffstat (limited to 'lib/diameter/src/transport/diameter_tcp.erl')
-rw-r--r--lib/diameter/src/transport/diameter_tcp.erl14
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