aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2022-05-26 17:48:59 +0200
committerKim Alvefur <zash@zash.se>2022-05-26 17:48:59 +0200
commit226d9f5ac5a04fcb7391a9cac49962b0171835af (patch)
treeb5e12c8b12127f3a2359f032a4f768f9522c3e3d /plugins
parentb0e3ea775a9e45d98fe2fa991ccad54a9ca87990 (diff)
parent8027b67f19bd54eb0d7847a77bf8d642f1d95f16 (diff)
downloadprosody-226d9f5ac5a04fcb7391a9cac49962b0171835af.tar.gz
prosody-226d9f5ac5a04fcb7391a9cac49962b0171835af.zip
Merge 0.12->trunk
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_smacks.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/plugins/mod_smacks.lua b/plugins/mod_smacks.lua
index 57d412ad..84231e26 100644
--- a/plugins/mod_smacks.lua
+++ b/plugins/mod_smacks.lua
@@ -160,7 +160,7 @@ local function should_ack(session, force)
if session.awaiting_ack then return end -- already waiting
if force then return force end
local queue = session.outgoing_stanza_queue;
- local expected_h = session.last_acknowledged_stanza + queue:count_unacked();
+ local expected_h = queue:count_acked() + queue:count_unacked();
local max_unacked = max_unacked_stanzas;
if session.state == "inactive" then
max_unacked = max_inactive_unacked_stanzas;
@@ -178,7 +178,7 @@ local function request_ack(session, reason)
if session.destroyed then return end -- sending something can trigger destruction
session.awaiting_ack = true;
-- expected_h could be lower than this expression e.g. more stanzas added to the queue meanwhile)
- session.last_requested_h = session.last_acknowledged_stanza + queue:count_unacked();
+ session.last_requested_h = queue:count_acked() + queue:count_unacked();
session.log("debug", "Sending <r> (inside timer, after send) from %s - #queue=%d", reason, queue:count_unacked());
if not session.delayed_ack_timer then
session.delayed_ack_timer = timer.add_task(delayed_ack_timeout, function()
@@ -240,7 +240,6 @@ end
local function wrap_session_out(session, resume)
if not resume then
session.outgoing_stanza_queue = smqueue.new(queue_size);
- session.last_acknowledged_stanza = 0;
end
add_filter(session, "stanzas/out", outgoing_stanza_filter, -999);