Software /
code /
prosody
Comparison
plugins/mod_smacks.lua @ 12067:97c377de8083
mod_smacks: Fix to not wait for acks from before a resumption
Otherwise it can get stuck waiting indefinitely for an ack that made it
notice the connection was stale.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 17 Dec 2021 17:20:26 +0100 |
parent | 12066:f07c8240a71d |
child | 12068:c3790ffdf467 |
comparison
equal
deleted
inserted
replaced
12066:f07c8240a71d | 12067:97c377de8083 |
---|---|
588 function session.send(stanza) -- luacheck: ignore 432 | 588 function session.send(stanza) -- luacheck: ignore 432 |
589 migrated_session_log("error", "Tried to send stanza on old session migrated by smacks resume (maybe there is a bug?): %s", tostring(stanza)); | 589 migrated_session_log("error", "Tried to send stanza on old session migrated by smacks resume (maybe there is a bug?): %s", tostring(stanza)); |
590 return false; | 590 return false; |
591 end | 591 end |
592 module:fire_event("smacks-hibernation-end", {origin = session, resumed = original_session, queue = queue:table()}); | 592 module:fire_event("smacks-hibernation-end", {origin = session, resumed = original_session, queue = queue:table()}); |
593 original_session.awaiting_ack = nil; -- Don't wait for acks from before the resumption | |
593 request_ack_if_needed(original_session, true, "handle_resume", nil); | 594 request_ack_if_needed(original_session, true, "handle_resume", nil); |
594 end | 595 end |
595 return true; | 596 return true; |
596 end | 597 end |
597 module:hook_tag(xmlns_sm2, "resume", function (session, stanza) return handle_resume(session, stanza, xmlns_sm2); end); | 598 module:hook_tag(xmlns_sm2, "resume", function (session, stanza) return handle_resume(session, stanza, xmlns_sm2); end); |