net_activate_ports: Use the default config option 'ports' when no option is specified.
authorWaqas Hussain <waqas20@gmail.com>
Thu, 10 Dec 2009 05:07:32 +0500
changeset 2352 a7ef564271a5
parent 2351 f8d002090cea
child 2353 54e650624ded
net_activate_ports: Use the default config option 'ports' when no option is specified.
prosody
--- a/prosody	Thu Dec 10 05:04:09 2009 +0500
+++ b/prosody	Thu Dec 10 05:07:32 2009 +0500
@@ -193,8 +193,9 @@
 	local cl = require "net.connlisteners";
 	function prosody.net_activate_ports(option, listener, default, conntype)
 		conntype = conntype or (global_ssl_ctx and "tls") or "tcp";
+		option = option and option.."_ports" or "ports";
 		if not cl.get(listener) then return; end
-		local ports = config.get("*", "core", option.."_ports") or default;
+		local ports = config.get("*", "core", option) or default;
 		if type(ports) == "number" then ports = {ports} end;
 		
 		if type(ports) ~= "table" then