Software /
code /
prosody
Changeset
2164:339a96689dcb
Merge with trunk
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 24 Nov 2009 20:35:18 +0000 |
parents | 2163:8d33f94dc3a1 (current diff) 2162:22b6b1899a55 (diff) |
children | 2166:fb01f0906564 |
files | |
diffstat | 1 files changed, 9 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/net/server.lua Tue Nov 24 20:34:22 2009 +0000 +++ b/net/server.lua Tue Nov 24 20:35:18 2009 +0000 @@ -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