mirror of
https://github.com/processone/ejabberd
synced 2025-10-04 18:29:20 +02:00
XEP-0198: Fix session timeout corner case
If the "resend_on_timeout" option is set to 'if_offline' and a pending stream management session is terminated because a new session is opened by the same resource (while no other resource is online), resend unacknowledged messages rather than bouncing error messages.
This commit is contained in:
parent
7435ee464f
commit
a31f59ea31
1 changed files with 10 additions and 2 deletions
|
@ -2833,8 +2833,16 @@ handle_unacked_stanzas(StateData)
|
||||||
Resend when is_boolean(Resend) ->
|
Resend when is_boolean(Resend) ->
|
||||||
Resend;
|
Resend;
|
||||||
if_offline ->
|
if_offline ->
|
||||||
ejabberd_sm:get_user_resources(StateData#state.user,
|
Resource = StateData#state.resource,
|
||||||
StateData#state.server) == []
|
case ejabberd_sm:get_user_resources(StateData#state.user,
|
||||||
|
StateData#state.server) of
|
||||||
|
[Resource] -> % Same resource opened new session
|
||||||
|
true;
|
||||||
|
[] ->
|
||||||
|
true;
|
||||||
|
_ ->
|
||||||
|
false
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
ReRoute = case ResendOnTimeout of
|
ReRoute = case ResendOnTimeout of
|
||||||
true ->
|
true ->
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue