mod_smacks: Don't ask for acks while in (csi) inactive mode
authorKim Alvefur <zash@zash.se>
Tue, 16 Feb 2021 19:16:21 +0100
changeset 4446 74da3643c62d
parent 4445 58a112bd9792
child 4447 0a56dc6c61af
mod_smacks: Don't ask for acks while in (csi) inactive mode The acks count as high priority events in mod_csi_simple and since they're sent after each stanza, it negated all optimizations.
mod_smacks/mod_smacks.lua
--- a/mod_smacks/mod_smacks.lua	Thu Feb 11 15:51:27 2021 +0100
+++ b/mod_smacks/mod_smacks.lua	Tue Feb 16 19:16:21 2021 +0100
@@ -162,7 +162,7 @@
 	local queue = session.outgoing_stanza_queue;
 	local expected_h = session.last_acknowledged_stanza + #queue;
 	-- session.log("debug", "*** SMACKS(1) ***: awaiting_ack=%s, hibernating=%s", tostring(session.awaiting_ack), tostring(session.hibernating));
-	if session.awaiting_ack == nil and not session.hibernating then
+	if session.awaiting_ack == nil and not session.hibernating and session.state ~= "inactive" then
 		-- this check of last_requested_h prevents ack-loops if missbehaving clients report wrong
 		-- stanza counts. it is set when an <r> is really sent (e.g. inside timer), preventing any
 		-- further requests until a higher h-value would be expected.