# HG changeset patch # User Matthew Wild # Date 1661531286 -3600 # Node ID 5a61e1603f4273a5e6b2f77715e3491593313fb8 # Parent 3b9771d496edb51cfe7d2f489ab181aa365429a4 mod_smacks: Don't close resuming session when failed due to overflow diff -r 3b9771d496ed -r 5a61e1603f42 plugins/mod_smacks.lua --- a/plugins/mod_smacks.lua Fri Aug 26 17:04:15 2022 +0100 +++ b/plugins/mod_smacks.lua Fri Aug 26 17:28:06 2022 +0100 @@ -570,9 +570,6 @@ session.log("debug", "mod_smacks resuming existing session %s...", original_session.id); - -- Update original_session with the parameters (connection, etc.) from the new session - sessionmanager.update_session(original_session, session); - local queue = original_session.outgoing_stanza_queue; local h = tonumber(stanza.attr.h); @@ -583,13 +580,17 @@ err = ack_errors.new("overflow"); end - if err or not queue:resumable() then - original_session.send(st.stanza("failed", + if err then + session.send(st.stanza("failed", { xmlns = xmlns_sm; h = format_h(original_session.handled_stanza_count); previd = id })); - original_session:close(err); - return false; + session.log("debug", "Resumption failed: %s", err); + return true; end + -- Update original_session with the parameters (connection, etc.) from the new session + sessionmanager.update_session(original_session, session); + + -- Inform client of successful resumption original_session.send(st.stanza("resumed", { xmlns = xmlns_sm, h = format_h(original_session.handled_stanza_count), previd = id }));