Software / code / prosody
Comparison
net/server.lua @ 8700:d611c46c6787
Backed out changeset a0f728c3aa69 in favor of 580c13ed0ca1
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Thu, 29 Mar 2018 16:57:18 +0200 |
| parent | 8686:a0f728c3aa69 |
| child | 8711:9932a2a5b6de |
comparison
equal
deleted
inserted
replaced
| 8699:580c13ed0ca1 | 8700:d611c46c6787 |
|---|---|
| 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 = "select"; | 9 local server_type = prosody and require "core.configmanager".get("*", "network_backend") or "select"; |
| 10 local ok, configmanager = pcall(require, "core.configmanager"); | 10 if prosody and require "core.configmanager".get("*", "use_libevent") then |
| 11 if ok then | 11 server_type = "event"; |
| 12 server_type = configmanager.get("*", "network_backend") or "select"; | |
| 13 if require "core.configmanager".get("*", "use_libevent") then | |
| 14 server_type = "event"; | |
| 15 end | |
| 16 end | 12 end |
| 17 | 13 |
| 18 if server_type == "event" then | 14 if server_type == "event" then |
| 19 if not pcall(require, "luaevent.core") then | 15 if not pcall(require, "luaevent.core") then |
| 20 log("error", "libevent not found, falling back to select()"); | 16 log("error", "libevent not found, falling back to select()"); |