mod_csi_simple: Detach cleanly from sessions if unloaded while flushing
authorKim Alvefur <zash@zash.se>
Tue, 16 Nov 2021 16:03:23 +0100
changeset 11920 5dae9262f81f
parent 11919 e0b58717f0c5
child 11921 d27b74b25105
mod_csi_simple: Detach cleanly from sessions if unloaded while flushing Since it changes the state to "flushing" while doing just that. Attempting to remove the filters from a session that does not have them should be a safe noop.
plugins/mod_csi_simple.lua
--- a/plugins/mod_csi_simple.lua	Tue Nov 16 15:00:02 2021 +0000
+++ b/plugins/mod_csi_simple.lua	Tue Nov 16 16:03:23 2021 +0100
@@ -214,7 +214,7 @@
 function module.unload()
 	for _, user_session in pairs(prosody.hosts[module.host].sessions) do
 		for _, session in pairs(user_session.sessions) do
-			if session.state == "inactive" then
+			if session.state and session.state ~= "active" then
 				disable_optimizations(session);
 			end
 		end