aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-11-24 20:35:18 +0000
committerMatthew Wild <mwild1@gmail.com>2009-11-24 20:35:18 +0000
commit23a0480d9b9bed9d4e115cecf64d7e6ab377c05c (patch)
tree77439722f12aa2d49befa131363b6fca01375078 /net
parentf5afdcb5642fb5260717613cc7909e20805a957c (diff)
parent3d08f189a3c6b83515273e99d7dca72693b8971a (diff)
downloadprosody-23a0480d9b9bed9d4e115cecf64d7e6ab377c05c.tar.gz
prosody-23a0480d9b9bed9d4e115cecf64d7e6ab377c05c.zip
Merge with trunk
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