mod_bosh: Use new httpserver helper to initialise ports

Sun, 12 Jul 2009 15:21:10 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Sun, 12 Jul 2009 15:21:10 +0100
changeset 1537
6670af04aeb6
parent 1536
8214458eacc8
child 1538
dff620405503

mod_bosh: Use new httpserver helper to initialise ports

plugins/mod_bosh.lua file | annotate | diff | comparison | revisions
--- a/plugins/mod_bosh.lua	Sun Jul 12 15:20:43 2009 +0100
+++ b/plugins/mod_bosh.lua	Sun Jul 12 15:21:10 2009 +0100
@@ -276,16 +276,6 @@
 end
 
 local ports = config.get(module.host, "core", "bosh_ports") or { 5280 };
-for _, options in ipairs(ports) do
-	local port, base, ssl, interface = 5280, "http-bind", false, nil;
-	if type(options) == "number" then
-		port = options;
-	elseif type(options) == "table" then
-		port, base, ssl, interface = options.port or 5280, options.path or "http-bind", options.ssl or false, options.interface;
-	elseif type(options) == "string" then
-		base = options;
-	end
-	httpserver.new{ port = port, base = base, handler = handle_request, ssl = ssl }
-end
+httpserver.new_from_config(ports, handle_request);
 
 server.addtimer(on_timer);

mercurial