Comparison

plugins/mod_bosh.lua @ 2354:5a00668ba0ab

mod_bosh: Delay setup until after server is started.
author Waqas Hussain <waqas20@gmail.com>
date Thu, 10 Dec 2009 16:21:06 +0500
parent 2099:73e083d01449
child 2373:13090fc6ad90
comparison
equal deleted inserted replaced
2353:54e650624ded 2354:5a00668ba0ab
296 dead_sessions[i] = nil; 296 dead_sessions[i] = nil;
297 sm_destroy_session(session, "BOSH client silent for over "..session.bosh_max_inactive.." seconds"); 297 sm_destroy_session(session, "BOSH client silent for over "..session.bosh_max_inactive.." seconds");
298 end 298 end
299 end 299 end
300 300
301 local ports = module:get_option("bosh_ports") or { 5280 }; 301
302 httpserver.new_from_config(ports, handle_request, { base = "http-bind" }); 302 local function setup()
303 303 local ports = module:get_option("bosh_ports") or { 5280 };
304 server.addtimer(on_timer); 304 httpserver.new_from_config(ports, handle_request, { base = "http-bind" });
305 server.addtimer(on_timer);
306 end
307 if prosody.start_time then -- already started
308 setup();
309 else
310 prosody.events.add_handler("server-started", setup);
311 end