]> granicus.if.org Git - ejabberd/commitdiff
mod_stream_mgmt: Clean up on timed out resumption
authorHolger Weiss <holger@zedat.fu-berlin.de>
Tue, 6 Mar 2018 20:03:31 +0000 (21:03 +0100)
committerHolger Weiss <holger@zedat.fu-berlin.de>
Tue, 6 Mar 2018 20:03:31 +0000 (21:03 +0100)
During resumption, make sure the old process and the corresponding
session entry are disposed also in the case where the call that queries
the old process times out.

src/mod_stream_mgmt.erl

index 0682762b44b1b7727925a0b9f03aa7a6e6d5fd8f..a8aeaaef006e760c975c66801f625ae7bd6f5d98 100644 (file)
@@ -664,6 +664,8 @@ inherit_session_state(#{user := U, server := S,
                          exit:{normal, _} ->
                            {error, <<"Previous session PID has exited">>};
                          exit:{timeout, _} ->
+                           ejabberd_sm:close_session(OldSID, U, S, R),
+                           ejabberd_c2s:stop(OldPID),
                            {error, <<"Session state copying timed out">>}
                    end
            end;