Mercurial > prosody-modules
changeset 2713:eea1d5bac451
mod_smacks: Fix delayed_ack event
After the first delayed ack every queued stanza should immediately
trigger the delayed_ack event.
author | tmolitor <thilo@eightysoft.de> |
---|---|
date | Mon, 08 May 2017 19:36:37 +0200 |
parents | d89ab70808f6 |
children | 75b137cf869a |
files | mod_smacks/mod_smacks.lua |
diffstat | 1 files changed, 10 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/mod_smacks/mod_smacks.lua Mon May 08 18:24:29 2017 +0200 +++ b/mod_smacks/mod_smacks.lua Mon May 08 19:36:37 2017 +0200 @@ -170,15 +170,17 @@ end end); end - -- Trigger "smacks-ack-delayed"-event if we added new (ackable) stanzas to the outgoing queue - -- and there isn't already a timer for this event running. - -- If we wouldn't do this, stanzas added to the queue after the first "smacks-ack-delayed"-event - -- would not trigger this event (again). - if #queue > max_unacked_stanzas and session.awaiting_ack and session.delayed_ack_timer == nil then - session.log("debug", "Calling delayed_ack_function directly (still waiting for ack)"); - delayed_ack_function(session); - end end + + -- Trigger "smacks-ack-delayed"-event if we added new (ackable) stanzas to the outgoing queue + -- and there isn't already a timer for this event running. + -- If we wouldn't do this, stanzas added to the queue after the first "smacks-ack-delayed"-event + -- would not trigger this event (again). + if #queue > max_unacked_stanzas and session.awaiting_ack and session.delayed_ack_timer == nil then + session.log("debug", "Calling delayed_ack_function directly (still waiting for ack)"); + delayed_ack_function(session); + end + session.last_queue_count = #queue; end