Comparison

plugins/mod_bosh.lua @ 5179:f3662fea95d9

mod_bosh: Share sessions and inactive_sessions tables
author Matthew Wild <mwild1@gmail.com>
date Thu, 15 Nov 2012 13:18:41 -0500
parent 5071:0382f456ac82
child 5185:ca30b21946ef
comparison
equal deleted inserted replaced
5177:add9ad38208e 5179:f3662fea95d9
68 end 68 end
69 69
70 local t_insert, t_remove, t_concat = table.insert, table.remove, table.concat; 70 local t_insert, t_remove, t_concat = table.insert, table.remove, table.concat;
71 local os_time = os.time; 71 local os_time = os.time;
72 72
73 local sessions = {}; 73 -- All sessions, and sessions that have no requests open
74 local inactive_sessions = {}; -- Sessions which have no open requests 74 local sessions, inactive_sessions = module:shared("sessions", "inactive_sessions");
75 75
76 -- Used to respond to idle sessions (those with waiting requests) 76 -- Used to respond to idle sessions (those with waiting requests)
77 local waiting_requests = {}; 77 local waiting_requests = {};
78 function on_destroy_request(request) 78 function on_destroy_request(request)
79 log("debug", "Request destroyed: %s", tostring(request)); 79 log("debug", "Request destroyed: %s", tostring(request));