25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-28 16:34:13 +01:00

Pretty print accepted transport address

This commit is contained in:
Evgeniy Khramtsov 2014-04-09 13:12:20 +04:00 committed by Christophe Romain
parent 66006ba017
commit a21edc2f3a

View File

@ -285,9 +285,10 @@ accept(ListenSocket, Module, Opts) ->
case gen_tcp:accept(ListenSocket) of case gen_tcp:accept(ListenSocket) of
{ok, Socket} -> {ok, Socket} ->
case {inet:sockname(Socket), inet:peername(Socket)} of case {inet:sockname(Socket), inet:peername(Socket)} of
{{ok, Addr}, {ok, PAddr}} -> {{ok, {Addr, Port}}, {ok, {PAddr, PPort}}} ->
?INFO_MSG("(~w) Accepted connection ~w -> ~w", ?INFO_MSG("(~w) Accepted connection ~s:~p -> ~s:~p",
[Socket, PAddr, Addr]); [Socket, inet_parse:ntoa(PAddr), PPort,
inet_parse:ntoa(Addr), Port]);
_ -> _ ->
ok ok
end, end,