mod_csi_simple: Disable optimizations on unload and re-enable on load

This commit is contained in:
Kim Alvefur 2019-03-24 20:43:15 +01:00
parent 1e77bb6ed2
commit e887ed5cad

View file

@ -111,3 +111,24 @@ module:hook("c2s-ondrain", function (event)
session.conn:pause_writes();
end
end);
function module.load()
for _, user_session in pairs(prosody.hosts[module.host].sessions) do
for _, session in pairs(user_session.sessions) do
if session.state == "inactive" then
enable_optimizations(session);
end
end
end
end
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
disble_optimizations(session);
end
end
end
end