Changeset

4616:03d9fe1bcdd3

portmanager: Fix pre-0.9 compatibility by taking default_interface and default_port from the listener instead of service table
author Matthew Wild <mwild1@gmail.com>
date Thu, 15 Mar 2012 03:02:09 +0000
parents 4615:29a9988c1e1b
children 4617:d8e56e6ac8d4
files core/portmanager.lua
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/core/portmanager.lua	Thu Mar 15 02:56:44 2012 +0000
+++ b/core/portmanager.lua	Thu Mar 15 03:02:09 2012 +0000
@@ -69,6 +69,8 @@
 		return nil, "Unknown service: "..service_name;
 	end
 	
+	local listener = service_info.listener;
+
 	local config_prefix = (service_info.config_prefix or service_name).."_";
 	if config_prefix == "_" then
 		config_prefix = "";
@@ -79,14 +81,13 @@
 		or (service_info.private and default_local_interfaces)
 		or config.get("*", "interfaces")
 		or config.get("*", "interface") -- COMPAT w/pre-0.9
-		or service_info.default_interface -- COMPAT w/pre0.9
+		or listener.default_interface -- COMPAT w/pre0.9
 		or default_interfaces);
 	
+	local bind_ports = set.new(config.get("*", config_prefix.."ports")
 		or service_info.default_ports
-		or {service_info.default_port});
-	local bind_ports = set.new(config.get("*", config_prefix.."ports")
+		or {listener.default_port}); -- COMPAT w/pre-0.9
 
-	local listener = service_info.listener;
 	local mode = listener.default_mode or "*a";
 	local ssl;
 	if service_info.encryption == "ssl" then