aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-03-23 18:02:37 +0100
committerKim Alvefur <zash@zash.se>2018-03-23 18:02:37 +0100
commitf769dbb2692f943f1c548a54d4f2e778aa11d35c (patch)
tree709965d29ed439087af6c9eabf98c26973091176
parent2fa049d2e15dba4aedba3e7009af45668c617823 (diff)
downloadprosody-f769dbb2692f943f1c548a54d4f2e778aa11d35c.tar.gz
prosody-f769dbb2692f943f1c548a54d4f2e778aa11d35c.zip
net.server: Try to require configmanager instead checking for the prosody global which does not yet exist when net.server is loaded now
-rw-r--r--net/server.lua10
1 files changed, 7 insertions, 3 deletions
diff --git a/net/server.lua b/net/server.lua
index 8b6fbc0b..76b06a2c 100644
--- a/net/server.lua
+++ b/net/server.lua
@@ -6,9 +6,13 @@
-- COPYING file in the source package for more information.
--
-local server_type = prosody and require "core.configmanager".get("*", "network_backend") or "select";
-if prosody and require "core.configmanager".get("*", "use_libevent") then
- server_type = "event";
+local server_type = "select";
+local ok, configmanager = pcall(require, "core.configmanager");
+if ok then
+ server_type = configmanager.get("*", "network_backend") or "select";
+ if require "core.configmanager".get("*", "use_libevent") then
+ server_type = "event";
+ end
end
if server_type == "event" then