Changeset

11938:6da703cb4c04

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.
author Kim Alvefur <zash@zash.se>
date Wed, 24 Nov 2021 21:27:49 +0100
parents 11937:364c3f018e3a
children 11939:9dbe73f244ca
files plugins/mod_smacks.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_smacks.lua	Wed Nov 24 21:27:49 2021 +0100
+++ b/plugins/mod_smacks.lua	Wed Nov 24 21:27:49 2021 +0100
@@ -236,7 +236,6 @@
 			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 @@
 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