aboutsummaryrefslogtreecommitdiffstats
path: root/net/server.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2013-03-23 20:06:02 +0100
committerKim Alvefur <zash@zash.se>2013-03-23 20:06:02 +0100
commit3ec1c834e665cbc60edeaff968899eef642b4450 (patch)
tree4a17402e08fb1e324c6bfc3a0ecea351bfa3592c /net/server.lua
parent0ef3252a3f63991bf901fa996085edef60634830 (diff)
downloadprosody-3ec1c834e665cbc60edeaff968899eef642b4450.tar.gz
prosody-3ec1c834e665cbc60edeaff968899eef642b4450.zip
net.server, _select: Reorganise configuration of server_select to be more like server_event
Diffstat (limited to 'net/server.lua')
-rw-r--r--net/server.lua14
1 files changed, 11 insertions, 3 deletions
diff --git a/net/server.lua b/net/server.lua
index deabaa12..ae3d45b0 100644
--- a/net/server.lua
+++ b/net/server.lua
@@ -42,6 +42,10 @@ 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("*", "network_settings") or {};
if use_luaevent then
@@ -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();