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
commitd31e3f31b57fcc0bb78e7d23b3abe00afeb46c93 (patch)
tree709965d29ed439087af6c9eabf98c26973091176
parent4872683a4207ad04e2adc611687dea3c7f729dc6 (diff)
downloadprosody-d31e3f31b57fcc0bb78e7d23b3abe00afeb46c93.tar.gz
prosody-d31e3f31b57fcc0bb78e7d23b3abe00afeb46c93.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