mirror of
https://github.com/bjc/prosody.git
synced 2025-04-03 21:27:38 +03:00
mod_csi_simple: Disable optimizations on unload and re-enable on load
This commit is contained in:
parent
1e77bb6ed2
commit
e887ed5cad
1 changed files with 21 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue