# HG changeset patch # User Waqas Hussain # Date 1260444066 -18000 # Node ID 5a00668ba0ab37f1e7c9b585b75037b31c848635 # Parent 54e650624ded6f26111312aecbc9c9c27be56eae mod_bosh: Delay setup until after server is started. diff -r 54e650624ded -r 5a00668ba0ab plugins/mod_bosh.lua --- a/plugins/mod_bosh.lua Thu Dec 10 05:08:59 2009 +0500 +++ b/plugins/mod_bosh.lua Thu Dec 10 16:21:06 2009 +0500 @@ -298,7 +298,14 @@ 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