aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2020-06-01 13:43:35 +0100
committerMatthew Wild <mwild1@gmail.com>2020-06-01 13:43:35 +0100
commit610be29e2a98547251da98091c65ff3111664b69 (patch)
tree724f9487d0dd311e1b0b2e3f38b91f9e792f795e /net
parentce129b96c7684d4270a7fae58ba5a9002837835c (diff)
downloadprosody-610be29e2a98547251da98091c65ff3111664b69.tar.gz
prosody-610be29e2a98547251da98091c65ff3111664b69.zip
net.server: Switch to epoll backend by default
(if util.poll is found)
Diffstat (limited to 'net')
-rw-r--r--net/server.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/server.lua b/net/server.lua
index abbb421d..f5666594 100644
--- a/net/server.lua
+++ b/net/server.lua
@@ -13,7 +13,11 @@ if not (prosody and prosody.config_loaded) then
end
local log = require "util.logger".init("net.server");
-local server_type = require "core.configmanager".get("*", "network_backend") or "select";
+
+local have_util_poll = pcall(require, "util.poll");
+local default_backend = have_util_poll and "epoll" or "select";
+
+local server_type = require "core.configmanager".get("*", "network_backend") or default_backend;
if require "core.configmanager".get("*", "use_libevent") then
server_type = "event";