aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-11-24 14:37:14 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-11-24 14:37:14 +0500
commit3d08f189a3c6b83515273e99d7dca72693b8971a (patch)
tree1eb378112478e3743b54037f621b16f4413ee2b7 /net
parentf4651d789af716615e950cb653e8f6a5b1ed0a63 (diff)
downloadprosody-3d08f189a3c6b83515273e99d7dca72693b8971a.tar.gz
prosody-3d08f189a3c6b83515273e99d7dca72693b8971a.zip
net.server: Log an error when libevent is requested, but luaevent is unavailable, and don't load luaevent when not requested.
Diffstat (limited to 'net')
-rw-r--r--net/server.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/net/server.lua b/net/server.lua
index a2325735..f77b216d 100644
--- a/net/server.lua
+++ b/net/server.lua
@@ -1,9 +1,16 @@
-local have_luaevent = pcall(require, "luaevent.core");
+
local use_luaevent = require "core.configmanager".get("*", "core", "use_libevent");
+if use_luaevent then
+ use_luaevent = pcall(require, "luaevent.core");
+ if not use_luaevent then
+ log("error", "libevent not found, falling back to select()");
+ end
+end
+
local server;
-if have_luaevent and use_luaevent == true then
+if use_luaevent then
server = require "net.server_event";
-- util.timer requires "net.server", so instead of having
-- Lua look for, and load us again (causing a loop) - set this here