25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-10-09 15:06:54 +02:00

ejabberd_s2s_in: Log message on connection close

Log a message when an incoming s2s connection is closed, analogous to
the message on outgoing s2s connection close.
This commit is contained in:
Holger Weiss 2018-08-29 16:23:56 +02:00
parent 66132353df
commit 8c8c480477

View File

@ -131,7 +131,15 @@ reject_unauthenticated_packet(State, _Pkt) ->
Err = xmpp:serr_not_authorized(),
send(State, Err).
process_closed(State, _Reason) ->
process_closed(#{server := LServer} = State, Reason) ->
RServer = case State of
#{remote_server := Name} ->
Name;
#{ip := IP} ->
ejabberd_config:may_hide_data(misc:ip_to_list(IP))
end,
?INFO_MSG("Closing inbound s2s connection ~s -> ~s: ~s",
[RServer, LServer, xmpp_stream_out:format_error(Reason)]),
stop(State).
%%%===================================================================