Software /
code /
prosody
Comparison
plugins/mod_smacks.lua @ 12047:81858fd6f198
mod_smacks: Flag both sessions to prevent duplicating queue on resumption
I have no idea what is going on in this code, which session is which?
Something has one of the sessions as an upvalue which is where the
filter checks for it.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 14 Dec 2021 12:59:38 +0100 |
parent | 12046:372ec5cd0f51 |
child | 12048:f087bfd021ad |
comparison
equal
deleted
inserted
replaced
12046:372ec5cd0f51 | 12047:81858fd6f198 |
---|---|
604 -- ...they are what is now left in the outgoing stanza queue | 604 -- ...they are what is now left in the outgoing stanza queue |
605 -- We have to use the send of "session" because we don't want to add our resent stanzas | 605 -- We have to use the send of "session" because we don't want to add our resent stanzas |
606 -- to the outgoing queue again | 606 -- to the outgoing queue again |
607 local queue = original_session.outgoing_stanza_queue; | 607 local queue = original_session.outgoing_stanza_queue; |
608 session.log("debug", "resending all unacked stanzas that are still queued after resume, #queue = %d", #queue); | 608 session.log("debug", "resending all unacked stanzas that are still queued after resume, #queue = %d", #queue); |
609 -- FIXME Which session is it that the queue filter sees? | |
609 session.resending_unacked = true; | 610 session.resending_unacked = true; |
611 original_session.resending_unacked = true; | |
610 for i=1,#queue do | 612 for i=1,#queue do |
611 session.send(queue[i]); | 613 session.send(queue[i]); |
612 end | 614 end |
613 session.resending_unacked = nil; | 615 session.resending_unacked = nil; |
616 original_session.resending_unacked = nil; | |
614 session.log("debug", "all stanzas resent, now disabling send() in this migrated session, #queue = %d", #queue); | 617 session.log("debug", "all stanzas resent, now disabling send() in this migrated session, #queue = %d", #queue); |
615 function session.send(stanza) -- luacheck: ignore 432 | 618 function session.send(stanza) -- luacheck: ignore 432 |
616 migrated_session_log("error", "Tried to send stanza on old session migrated by smacks resume (maybe there is a bug?): %s", tostring(stanza)); | 619 migrated_session_log("error", "Tried to send stanza on old session migrated by smacks resume (maybe there is a bug?): %s", tostring(stanza)); |
617 return false; | 620 return false; |
618 end | 621 end |