aboutsummaryrefslogtreecommitdiffstats
path: root/net/server.lua
diff options
context:
space:
mode:
Diffstat (limited to 'net/server.lua')
-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