25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

XEP-0198: Log message when waiting for resumption

Log an informational message when a session goes into the pending state
(waiting for resumption) after the connection was lost.  Administrators
may well be interested in this state change when looking into issues.
This commit is contained in:
Holger Weiss 2014-05-04 23:08:42 +02:00
parent a21d2298af
commit a0917a8e9b

View File

@ -1179,6 +1179,7 @@ session_established(closed, StateData)
when StateData#state.resume_timeout > 0,
StateData#state.sm_state == active orelse
StateData#state.sm_state == pending ->
log_pending_state(StateData),
fsm_next_state(wait_for_resume, StateData#state{sm_state = pending});
session_established(closed, StateData) ->
{stop, normal, StateData}.
@ -1664,6 +1665,7 @@ handle_info({'DOWN', Monitor, _Type, _Object, _Info},
if StateData#state.resume_timeout > 0,
StateData#state.sm_state == active orelse
StateData#state.sm_state == pending ->
log_pending_state(StateData),
fsm_next_state(wait_for_resume, StateData#state{sm_state = pending});
true ->
{stop, normal, StateData}
@ -2785,6 +2787,12 @@ limit_queue_length(#state{jid = JID,
StateData
end.
log_pending_state(StateData) when StateData#state.sm_state /= pending ->
?INFO_MSG("Waiting for resumption of stream for ~s",
[jlib:jid_to_string(StateData#state.jid)]);
log_pending_state(_StateData) ->
ok.
handle_unacked_stanzas(StateData, F) when StateData#state.sm_state == active;
StateData#state.sm_state == pending ->
Queue = StateData#state.ack_queue,