Comparison

plugins/mod_csi_simple.lua @ 9919:d602a495409b

mod_csi_simple: Disable optimizations on unload and re-enable on load
author Kim Alvefur <zash@zash.se>
date Sun, 24 Mar 2019 20:43:15 +0100
parent 9918:6e9dcec259d0
child 9920:4a56d7891bd3
comparison
equal deleted inserted replaced
9918:6e9dcec259d0 9919:d602a495409b
109 if session.state == "inactive" and session.conn and session.conn and session.conn.pause_writes then 109 if session.state == "inactive" and session.conn and session.conn and session.conn.pause_writes then
110 session.csi_counter = 0; 110 session.csi_counter = 0;
111 session.conn:pause_writes(); 111 session.conn:pause_writes();
112 end 112 end
113 end); 113 end);
114
115 function module.load()
116 for _, user_session in pairs(prosody.hosts[module.host].sessions) do
117 for _, session in pairs(user_session.sessions) do
118 if session.state == "inactive" then
119 enable_optimizations(session);
120 end
121 end
122 end
123 end
124
125 function module.unload()
126 for _, user_session in pairs(prosody.hosts[module.host].sessions) do
127 for _, session in pairs(user_session.sessions) do
128 if session.state == "inactive" then
129 disble_optimizations(session);
130 end
131 end
132 end
133 end
134