Software /
code /
prosody
Comparison
net/server.lua @ 11762:54530085dffe
net.server: Fall back to default backend from libevent instead of always select
Fixes that selecting libevent when unavaibalbe would fall back to select
instead of epoll, even if that's available.
This way, we only have to update it in once place when choosing a new
default.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 03 Sep 2021 17:35:34 +0200 |
parent | 10853:0107ed6744aa |
child | 11763:e273ef869794 |
comparison
equal
deleted
inserted
replaced
11761:dbf378dcf27b | 11762:54530085dffe |
---|---|
23 server_type = "event"; | 23 server_type = "event"; |
24 end | 24 end |
25 | 25 |
26 if server_type == "event" then | 26 if server_type == "event" then |
27 if not pcall(require, "luaevent.core") then | 27 if not pcall(require, "luaevent.core") then |
28 log("error", "libevent not found, falling back to select()"); | 28 log("error", "libevent not found, falling back to %s", default_backend); |
29 server_type = "select" | 29 server_type = default_backend; |
30 end | 30 end |
31 end | 31 end |
32 | 32 |
33 local server; | 33 local server; |
34 local set_config; | 34 local set_config; |