# HG changeset patch # User Kim Alvefur # Date 1639692290 -3600 # Node ID 4972244fe87b9515e3f8bcadeb5ac21309ab95ee # Parent 31a7e0ac6928ea5c62fbb5f27e0e7e5998a2a3bb mod_smacks: Cancel hibernation when session is closed To ensure that if a session is replaced after it has gone into hibernation, it does not come back and cause trouble for the new session (see previous commit). diff -r 31a7e0ac6928 -r 4972244fe87b plugins/mod_smacks.lua --- a/plugins/mod_smacks.lua Thu Dec 16 22:59:51 2021 +0100 +++ b/plugins/mod_smacks.lua Thu Dec 16 23:04:50 2021 +0100 @@ -225,6 +225,12 @@ old_session_registry:set(session.username, session.resumption_token, nil); session.resumption_token = nil; end + if session.hibernating_watchdog then + -- If the session is being replaced instead of resume, we don't want the + -- old session around to time out and cause trouble for the new session + session.hibernating_watchdog:cancel(); + session.hibernating_watchdog = nil; + end -- send out last ack as per revision 1.5.2 of XEP-0198 if session.smacks and session.conn and session.handled_stanza_count then (session.sends2s or session.send)(st.stanza("a", {