mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-24 16:23:40 +01:00
Pretty print accepted transport address
This commit is contained in:
parent
66006ba017
commit
a21edc2f3a
@ -285,9 +285,10 @@ accept(ListenSocket, Module, Opts) ->
|
||||
case gen_tcp:accept(ListenSocket) of
|
||||
{ok, Socket} ->
|
||||
case {inet:sockname(Socket), inet:peername(Socket)} of
|
||||
{{ok, Addr}, {ok, PAddr}} ->
|
||||
?INFO_MSG("(~w) Accepted connection ~w -> ~w",
|
||||
[Socket, PAddr, Addr]);
|
||||
{{ok, {Addr, Port}}, {ok, {PAddr, PPort}}} ->
|
||||
?INFO_MSG("(~w) Accepted connection ~s:~p -> ~s:~p",
|
||||
[Socket, inet_parse:ntoa(PAddr), PPort,
|
||||
inet_parse:ntoa(Addr), Port]);
|
||||
_ ->
|
||||
ok
|
||||
end,
|
||||
|
Loading…
Reference in New Issue
Block a user