Mercurial > prosody-hg
comparison net/server.lua @ 8686:a0f728c3aa69
net.server: Try to require configmanager instead checking for the prosody global which does not yet exist when net.server is loaded now
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 23 Mar 2018 18:02:37 +0100 |
| parents | 9606a99f8617 |
| children | d611c46c6787 |
comparison
equal
deleted
inserted
replaced
| 8685:2548111e71d6 | 8686:a0f728c3aa69 |
|---|---|
| 4 -- | 4 -- |
| 5 -- This project is MIT/X11 licensed. Please see the | 5 -- This project is MIT/X11 licensed. Please see the |
| 6 -- COPYING file in the source package for more information. | 6 -- COPYING file in the source package for more information. |
| 7 -- | 7 -- |
| 8 | 8 |
| 9 local server_type = prosody and require "core.configmanager".get("*", "network_backend") or "select"; | 9 local server_type = "select"; |
| 10 if prosody and require "core.configmanager".get("*", "use_libevent") then | 10 local ok, configmanager = pcall(require, "core.configmanager"); |
| 11 server_type = "event"; | 11 if ok then |
| 12 server_type = configmanager.get("*", "network_backend") or "select"; | |
| 13 if require "core.configmanager".get("*", "use_libevent") then | |
| 14 server_type = "event"; | |
| 15 end | |
| 12 end | 16 end |
| 13 | 17 |
| 14 if server_type == "event" then | 18 if server_type == "event" then |
| 15 if not pcall(require, "luaevent.core") then | 19 if not pcall(require, "luaevent.core") then |
| 16 log("error", "libevent not found, falling back to select()"); | 20 log("error", "libevent not found, falling back to select()"); |
