aboutsummaryrefslogtreecommitdiffstats
path: root/net/server.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2013-03-28 12:17:15 +0000
committerMatthew Wild <mwild1@gmail.com>2013-03-28 12:17:15 +0000
commit0f44b53c15ed12d163902afaf93a88442d4c97d2 (patch)
tree3cea0291902a5fcdc82a59e5fe1747c4f8217900 /net/server.lua
parent11a3a158eb42284dd3585e04439f38ee3e6d548c (diff)
parent64440086ea5ee8d2f1726f2101ced46d4f08b929 (diff)
downloadprosody-0f44b53c15ed12d163902afaf93a88442d4c97d2.tar.gz
prosody-0f44b53c15ed12d163902afaf93a88442d4c97d2.zip
Merge 0.9->trunk
Diffstat (limited to 'net/server.lua')
-rw-r--r--net/server.lua18
1 files changed, 13 insertions, 5 deletions
diff --git a/net/server.lua b/net/server.lua
index 3cdbe551..ae3d45b0 100644
--- a/net/server.lua
+++ b/net/server.lua
@@ -6,7 +6,7 @@
-- COPYING file in the source package for more information.
--
-local use_luaevent = prosody and require "core.configmanager".get("*", "core", "use_libevent");
+local use_luaevent = prosody and require "core.configmanager".get("*", "use_libevent");
if use_luaevent then
use_luaevent = pcall(require, "luaevent.core");
@@ -42,8 +42,12 @@ end
if prosody then
local config_get = require "core.configmanager".get;
+ local defaults = {};
+ for k,v in pairs(server.cfg or server.getsettings()) do
+ defaults[k] = v;
+ end
local function load_config()
- local settings = config_get("*", "core", "network_settings") or {};
+ local settings = config_get("*", "network_settings") or {};
if use_luaevent then
local event_settings = {
ACCEPT_DELAY = settings.event_accept_retry_interval;
@@ -59,11 +63,15 @@ if prosody then
WRITE_TIMEOUT = settings.send_timeout;
};
- for k, v in pairs(event_settings) do
- server.cfg[k] = v;
+ for k,default in pairs(defaults) do
+ server.cfg[k] = event_settings[k] or default;
end
else
- server.changesettings(settings);
+ local select_settings = {};
+ for k,default in pairs(defaults) do
+ select_settings[k] = settings[k] or default;
+ end
+ server.changesettings(select_settings);
end
end
load_config();