prosody, prosodyctl, util.dependencies: Split checking and logging of dependencies so we can check hard deps before the config and logging is loaded

This commit is contained in:
Matthew Wild 2010-12-20 14:06:16 +00:00
parent e626770ceb
commit 6d96edf726
3 changed files with 23 additions and 14 deletions

View file

@ -78,11 +78,6 @@ function check_dependencies()
["luarocks"] = "luarocks install luasec";
["Source"] = "http://www.inf.puc-rio.br/~brunoos/luasec/";
}, "SSL/TLS support will not be available");
else
local major, minor, veryminor, patched = ssl._VERSION:match("(%d+)%.(%d+)%.?(%d*)(M?)");
if not major or ((tonumber(major) == 0 and (tonumber(minor) or 0) <= 3 and (tonumber(veryminor) or 0) <= 2) and patched ~= "M") then
log("error", "This version of LuaSec contains a known bug that causes disconnects, see http://prosody.im/doc/depends");
end
end
local encodings, err = softreq "util.encodings"
@ -121,5 +116,13 @@ function check_dependencies()
return not fatal;
end
function log_warnings()
if ssl then
local major, minor, veryminor, patched = ssl._VERSION:match("(%d+)%.(%d+)%.?(%d*)(M?)");
if not major or ((tonumber(major) == 0 and (tonumber(minor) or 0) <= 3 and (tonumber(veryminor) or 0) <= 2) and patched ~= "M") then
log("error", "This version of LuaSec contains a known bug that causes disconnects, see http://prosody.im/doc/depends");
end
end
end
return _M;