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
|
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,
|
||||||
|
Loading…
Reference in New Issue
Block a user