aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_csi_simple.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-11-20 23:54:43 +0100
committerKim Alvefur <zash@zash.se>2021-11-20 23:54:43 +0100
commit8a949f83e262f5ba4010c9ddb5cb7640c3c46c86 (patch)
tree3eea5955114925feb0405fab2b2eca734aa2bf56 /plugins/mod_csi_simple.lua
parent349968eb674b1a4f3f42edc97637126e790448cc (diff)
downloadprosody-8a949f83e262f5ba4010c9ddb5cb7640c3c46c86.tar.gz
prosody-8a949f83e262f5ba4010c9ddb5cb7640c3c46c86.zip
mod_csi_simple: Skip initiating flush in all but inactive state
Both in the flushing and active states the right thing to do is skip directly to returning the data. Also in any unknown state, like if the filter is somehow left behind on module unload.
Diffstat (limited to 'plugins/mod_csi_simple.lua')
-rw-r--r--plugins/mod_csi_simple.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/mod_csi_simple.lua b/plugins/mod_csi_simple.lua
index a2aeceef..2420705a 100644
--- a/plugins/mod_csi_simple.lua
+++ b/plugins/mod_csi_simple.lua
@@ -143,7 +143,7 @@ end
local function flush_buffer(data, session)
local ctr = session.csi_counter or 0;
- if ctr == 0 or session.state == "flushing" then return data end
+ if ctr == 0 or session.state ~= "inactive" then return data end
session.log("debug", "Flushing buffer (%s; queue size is %d)", "client activity", session.csi_counter);
session.state = "flushing";
module:fire_event("csi-flushing", { session = session });