From 3d65df61e3f4741236d65c8ac3595f9bcf7d8c15 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Thu, 10 Dec 2009 16:21:06 +0500 Subject: mod_bosh: Delay setup until after server is started. --- plugins/mod_bosh.lua | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/plugins/mod_bosh.lua b/plugins/mod_bosh.lua index 5de79eff..db70006c 100644 --- a/plugins/mod_bosh.lua +++ b/plugins/mod_bosh.lua @@ -298,7 +298,14 @@ function on_timer() end end -local ports = module:get_option("bosh_ports") or { 5280 }; -httpserver.new_from_config(ports, handle_request, { base = "http-bind" }); -server.addtimer(on_timer); +local function setup() + local ports = module:get_option("bosh_ports") or { 5280 }; + httpserver.new_from_config(ports, handle_request, { base = "http-bind" }); + server.addtimer(on_timer); +end +if prosody.start_time then -- already started + setup(); +else + prosody.events.add_handler("server-started", setup); +end -- cgit v1.2.3