mod_csi_simple: Skip initiating flush in all but inactive state
authorKim Alvefur <zash@zash.se>
Sat, 20 Nov 2021 23:54:43 +0100
changeset 11932 16cf863b36c0
parent 11931 4d63d8ef1cf9
child 11933 85d51bfcf56b
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.
plugins/mod_csi_simple.lua
--- a/plugins/mod_csi_simple.lua	Sat Nov 20 22:50:51 2021 +0100
+++ b/plugins/mod_csi_simple.lua	Sat Nov 20 23:54:43 2021 +0100
@@ -143,7 +143,7 @@
 
 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 });