aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-12-10 16:21:06 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-12-10 16:21:06 +0500
commit3d65df61e3f4741236d65c8ac3595f9bcf7d8c15 (patch)
tree462c62d3688b564813d6f42f78f6019f7bc42c74
parent87d8bdbc64e2e4fd5c1db01d7570e83c37293cd2 (diff)
downloadprosody-3d65df61e3f4741236d65c8ac3595f9bcf7d8c15.tar.gz
prosody-3d65df61e3f4741236d65c8ac3595f9bcf7d8c15.zip
mod_bosh: Delay setup until after server is started.
-rw-r--r--plugins/mod_bosh.lua13
1 files 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