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.
--- 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