aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_smacks.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-11-24 21:27:49 +0100
committerKim Alvefur <zash@zash.se>2021-11-24 21:27:49 +0100
commitbbfe15dac5b144d69f3fcd6c3254f664eb3adf7e (patch)
tree093c078c824cf445a76efff09d186846670bc7e2 /plugins/mod_smacks.lua
parentfaff262ac8756de29154132b0e32097bd9f38e5b (diff)
downloadprosody-bbfe15dac5b144d69f3fcd6c3254f664eb3adf7e.tar.gz
prosody-bbfe15dac5b144d69f3fcd6c3254f664eb3adf7e.zip
mod_smacks: Optimize scheduling of ack requests
Taking advantage of the new callbacks added in dcf38ac6a38c and 9c450185bac1 avoids extra timers, extra syscalls and sending the `<r>` in its own TCP segment, improving efficiency.
Diffstat (limited to 'plugins/mod_smacks.lua')
-rw-r--r--plugins/mod_smacks.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/mod_smacks.lua b/plugins/mod_smacks.lua
index 54da11b6..2387c0f4 100644
--- a/plugins/mod_smacks.lua
+++ b/plugins/mod_smacks.lua
@@ -236,7 +236,6 @@ local function outgoing_stanza_filter(stanza, session)
module:fire_event("smacks-hibernation-stanza-queued", {origin = session, queue = queue, stanza = cached_stanza});
return nil;
end
- request_ack_if_needed(session, false, "outgoing_stanza_filter", stanza);
end
return stanza;
end
@@ -652,6 +651,8 @@ module:hook_tag(xmlns_sm3, "resume", function (session, stanza) return handle_re
local request_ack_events = {
["csi-client-active"] = true;
["csi-flushing"] = false;
+ ["c2s-pre-ondrain"] = false;
+ ["s2s-pre-ondrain"] = false;
};
for event_name, force in pairs(request_ack_events) do