Comparison

core/portmanager.lua @ 5319:d20861bf900b

portmanager: Make sure foo_ports is a table
author Kim Alvefur <zash@zash.se>
date Thu, 31 Jan 2013 15:48:55 +0100
parent 5225:079e4cb23f89
child 5391:0d49a4e9963b
comparison
equal deleted inserted replaced
5318:989acb4ad1de 5319:d20861bf900b
87 or config.get("*", "interface") -- COMPAT w/pre-0.9 87 or config.get("*", "interface") -- COMPAT w/pre-0.9
88 or listener.default_interface -- COMPAT w/pre0.9 88 or listener.default_interface -- COMPAT w/pre0.9
89 or default_interfaces 89 or default_interfaces
90 bind_interfaces = set.new(type(bind_interfaces)~="table" and {bind_interfaces} or bind_interfaces); 90 bind_interfaces = set.new(type(bind_interfaces)~="table" and {bind_interfaces} or bind_interfaces);
91 91
92 local bind_ports = set.new(config.get("*", config_prefix.."ports") 92 local bind_ports = config.get("*", config_prefix.."ports")
93 or service_info.default_ports 93 or service_info.default_ports
94 or {service_info.default_port 94 or {service_info.default_port
95 or listener.default_port -- COMPAT w/pre-0.9 95 or listener.default_port -- COMPAT w/pre-0.9
96 }); 96 }
97 bind_ports = set.new(type(bind_ports) ~= "table" and { bind_ports } or bind_ports );
97 98
98 local mode, ssl = listener.default_mode or "*a"; 99 local mode, ssl = listener.default_mode or "*a";
99 100
100 for interface in bind_interfaces do 101 for interface in bind_interfaces do
101 for port in bind_ports do 102 for port in bind_ports do