mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-24 16:23:40 +01:00
XEP-0198: Let fsm_next_state/2 check timeout value
Don't force the fsm_next_state/2 caller to check for 'mgmt_timeout = 0'.
This commit is contained in:
parent
646b445515
commit
11b2921971
@ -1196,9 +1196,7 @@ session_established({xmlstreamerror, _}, StateData) ->
|
||||
send_element(StateData, ?INVALID_XML_ERR),
|
||||
send_trailer(StateData),
|
||||
{stop, normal, StateData};
|
||||
session_established(closed, StateData)
|
||||
when StateData#state.mgmt_timeout > 0,
|
||||
StateData#state.mgmt_state == active ->
|
||||
session_established(closed, #state{mgmt_state = active} = StateData) ->
|
||||
fsm_next_state(wait_for_resume, StateData);
|
||||
session_established(closed, StateData) ->
|
||||
{stop, normal, StateData}.
|
||||
@ -1682,8 +1680,7 @@ handle_info({route, From, To,
|
||||
handle_info({'DOWN', Monitor, _Type, _Object, _Info},
|
||||
_StateName, StateData)
|
||||
when Monitor == StateData#state.socket_monitor ->
|
||||
if StateData#state.mgmt_timeout > 0,
|
||||
StateData#state.mgmt_state == active orelse
|
||||
if StateData#state.mgmt_state == active;
|
||||
StateData#state.mgmt_state == pending ->
|
||||
fsm_next_state(wait_for_resume, StateData);
|
||||
true ->
|
||||
@ -2461,6 +2458,8 @@ fsm_next_state_gc(StateName, PackedStateData) ->
|
||||
fsm_next_state(session_established, StateData) ->
|
||||
{next_state, session_established, StateData,
|
||||
?C2S_HIBERNATE_TIMEOUT};
|
||||
fsm_next_state(wait_for_resume, #state{mgmt_timeout = 0} = StateData) ->
|
||||
{stop, normal, StateData};
|
||||
fsm_next_state(wait_for_resume, StateData)
|
||||
when StateData#state.mgmt_state /= pending ->
|
||||
?INFO_MSG("Waiting for resumption of stream for ~s",
|
||||
|
Loading…
Reference in New Issue
Block a user