aboutsummaryrefslogtreecommitdiffstats
path: root/core/portmanager.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-03-06 01:14:32 +0100
committerKim Alvefur <zash@zash.se>2017-03-06 01:14:32 +0100
commitca65f0d2d3718301b880c0260c991cd8ee7977ae (patch)
treee58db2bf464bf09301a9c02c27330c2dba6b926d /core/portmanager.lua
parentb133b78d47ff180110b0b29612d3cd257a9972c1 (diff)
parente45c5961ac42007aa6c9282afddff91cd1e27124 (diff)
downloadprosody-ca65f0d2d3718301b880c0260c991cd8ee7977ae.tar.gz
prosody-ca65f0d2d3718301b880c0260c991cd8ee7977ae.zip
Merge 0.10->trunk
Diffstat (limited to 'core/portmanager.lua')
-rw-r--r--core/portmanager.lua12
1 files changed, 8 insertions, 4 deletions
diff --git a/core/portmanager.lua b/core/portmanager.lua
index ad1a0be3..5b6476f3 100644
--- a/core/portmanager.lua
+++ b/core/portmanager.lua
@@ -103,7 +103,8 @@ local function activate(service_name)
if not port_number then
log("error", "Invalid port number specified for service '%s': %s", service_info.name, tostring(port));
elseif #active_services:search(nil, interface, port_number) > 0 then
- log("error", "Multiple services configured to listen on the same port ([%s]:%d): %s, %s", interface, port, active_services:search(nil, interface, port)[1][1].service.name or "<unnamed>", service_name or "<unnamed>");
+ log("error", "Multiple services configured to listen on the same port ([%s]:%d): %s, %s", interface, port,
+ active_services:search(nil, interface, port)[1][1].service.name or "<unnamed>", service_name or "<unnamed>");
else
local err;
-- Create SSL context for this service/port
@@ -118,14 +119,16 @@ local function activate(service_name)
global_ssl_config[interface],
global_ssl_config[port]);
if not ssl then
- log("error", "Error binding encrypted port for %s: %s", service_info.name, error_to_friendly_message(service_name, port_number, err) or "unknown error");
+ log("error", "Error binding encrypted port for %s: %s", service_info.name,
+ error_to_friendly_message(service_name, port_number, err) or "unknown error");
end
end
if not err then
-- Start listening on interface+port
local handler, err = server.addserver(interface, port_number, listener, mode, ssl);
if not handler then
- log("error", "Failed to open server port %d on %s, %s", port_number, interface, error_to_friendly_message(service_name, port_number, err));
+ log("error", "Failed to open server port %d on %s, %s", port_number, interface,
+ error_to_friendly_message(service_name, port_number, err));
else
table.insert(hooked_ports, "["..interface.."]:"..port_number);
log("debug", "Added listening service %s to [%s]:%d", service_name, interface, port_number);
@@ -138,7 +141,8 @@ local function activate(service_name)
end
end
end
- log("info", "Activated service '%s' on %s", service_name, #hooked_ports == 0 and "no ports" or table.concat(hooked_ports, ", "));
+ log("info", "Activated service '%s' on %s", service_name,
+ #hooked_ports == 0 and "no ports" or table.concat(hooked_ports, ", "));
return true;
end