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
1 changed files with 9 additions and 1 deletions

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).
%%%===================================================================