aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2022-08-26 17:28:06 +0100
committerMatthew Wild <mwild1@gmail.com>2022-08-26 17:28:06 +0100
commit9c5aefe7e7a884a3749133e85b3725e1472b471f (patch)
tree9a2692a79d595d731d5410d0f4e3842c57aaf4d2
parent54fcc029c8fafd6e9fd9a38e279e5557177c1370 (diff)
downloadprosody-9c5aefe7e7a884a3749133e85b3725e1472b471f.tar.gz
prosody-9c5aefe7e7a884a3749133e85b3725e1472b471f.zip
mod_smacks: Don't close resuming session when failed due to overflow
-rw-r--r--plugins/mod_smacks.lua15
1 files changed, 8 insertions, 7 deletions
diff --git a/plugins/mod_smacks.lua b/plugins/mod_smacks.lua
index a1435829..42a903f6 100644
--- a/plugins/mod_smacks.lua
+++ b/plugins/mod_smacks.lua
@@ -570,9 +570,6 @@ function handle_resume(session, stanza, xmlns_sm)
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 @@ function handle_resume(session, stanza, xmlns_sm)
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 }));