# HG changeset patch # User Kim Alvefur # Date 1485725523 -3600 # Node ID 2fdb7b3648d8e83351012dabb3a8302b2096221d # Parent de3c6fb747590931c5b3c77aa6743fad56e95a7c# Parent 23c7e3bfd299e1eb937fe4640df8b509112e71df Merge 0.10->trunk diff -r de3c6fb74759 -r 2fdb7b3648d8 prosody --- a/prosody Sat Jan 28 21:39:14 2017 +0100 +++ b/prosody Sun Jan 29 22:32:03 2017 +0100 @@ -2,7 +2,7 @@ -- Prosody IM -- Copyright (C) 2008-2010 Matthew Wild -- Copyright (C) 2008-2010 Waqas Hussain --- +-- -- This project is MIT/X11 licensed. Please see the -- COPYING file in the source package for more information. -- @@ -60,13 +60,13 @@ config = require "core.configmanager" -- -- -- -- --- Define the functions we call during startup, the +-- Define the functions we call during startup, the -- actual startup happens right at the end, where these -- functions get called function read_config() local filenames = {}; - + local filename; if arg[1] == "--config" and arg[2] then table.insert(filenames, arg[2]); @@ -129,9 +129,10 @@ function load_libraries() -- Load socket framework + -- luacheck: ignore 111/server 111/socket socket = require "socket"; server = require "net.server" -end +end -- The global log() gets defined by loggingmanager -- luacheck: ignore 113/log @@ -227,7 +228,7 @@ bare_sessions = prosody.bare_sessions; full_sessions = prosody.full_sessions; hosts = prosody.hosts; - + local data_path = config.get("*", "data_path") or CFG_DATADIR or "data"; local custom_plugin_paths = config.get("*", "plugin_paths"); if custom_plugin_paths then @@ -235,7 +236,7 @@ -- path1;path2;path3;defaultpath... CFG_PLUGINDIR = table.concat(custom_plugin_paths, path_sep)..path_sep..(CFG_PLUGINDIR or "plugins"); end - prosody.paths = { source = CFG_SOURCEDIR, config = CFG_CONFIGDIR or ".", + prosody.paths = { source = CFG_SOURCEDIR, config = CFG_CONFIGDIR or ".", plugins = CFG_PLUGINDIR or "plugins", data = data_path }; prosody.arg = _G.arg; @@ -246,12 +247,12 @@ elseif package.config:sub(1,1) == "/" then prosody.platform = "posix"; end - + prosody.installed = nil; if CFG_SOURCEDIR and (prosody.platform == "windows" or CFG_SOURCEDIR:match("^/")) then prosody.installed = true; end - + if prosody.installed then -- Change working directory to data path. require "lfs".chdir(data_path); @@ -323,18 +324,18 @@ end}); require "net.http" - + require "util.array" require "util.datetime" require "util.iterators" require "util.timer" require "util.helpers" - + pcall(require, "util.signal") -- Not on Windows - - -- Commented to protect us from + + -- Commented to protect us from -- the second kind of people - --[[ + --[[ pcall(require, "remdebug.engine"); if remdebug then remdebug.engine.start() end ]] @@ -352,7 +353,7 @@ -- Signal to modules that we are ready to start prosody.events.fire_event("server-starting"); prosody.start_time = os.time(); -end +end function init_global_protection() -- Catch global accesses @@ -361,11 +362,11 @@ __index = function (t, k) log("warn", "%s", debug.traceback("Attempt to read a non-existent global '"..tostring(k).."'", 2)); end; __newindex = function (t, k, v) error("Attempt to set a global: "..tostring(k).." = "..tostring(v), 2); end; }; - + function prosody.unlock_globals() setmetatable(_G, nil); end - + function prosody.lock_globals() setmetatable(_G, locked_globals_mt); end @@ -380,16 +381,16 @@ if type(err) == "string" and err:match("interrupted!$") then return "quitting"; end - + log("error", "Top-level error, please report:\n%s", tostring(err)); local traceback = debug.traceback("", 2); if traceback then log("error", "%s", traceback); end - + prosody.events.fire_event("very-bad-error", {error = err, traceback = traceback}); end - + local sleep = require"socket".sleep; while select(2, xpcall(server.loop, catch_uncaught_error)) ~= "quitting" do diff -r de3c6fb74759 -r 2fdb7b3648d8 util/dependencies.lua --- a/util/dependencies.lua Sat Jan 28 21:39:14 2017 +0100 +++ b/util/dependencies.lua Sun Jan 29 22:32:03 2017 +0100 @@ -82,10 +82,10 @@ local lfs, err = softreq "lfs" if not lfs then missingdep("luafilesystem", { - ["luarocks"] = "luarocks install luafilesystem"; - ["Debian/Ubuntu"] = "sudo apt-get install lua-filesystem"; - ["Source"] = "http://www.keplerproject.org/luafilesystem/"; - }); + ["luarocks"] = "luarocks install luafilesystem"; + ["Debian/Ubuntu"] = "sudo apt-get install lua-filesystem"; + ["Source"] = "http://www.keplerproject.org/luafilesystem/"; + }); fatal = true; end @@ -112,9 +112,10 @@ local encodings, err = softreq "util.encodings" if not encodings then if err:match("module '[^']*' not found") then - missingdep("util.encodings", { ["Windows"] = "Make sure you have encodings.dll from the Prosody distribution in util/"; - ["GNU/Linux"] = "Run './configure' and 'make' in the Prosody source directory to build util/encodings.so"; - }); + missingdep("util.encodings", { + ["Windows"] = "Make sure you have encodings.dll from the Prosody distribution in util/"; + ["GNU/Linux"] = "Run './configure' and 'make' in the Prosody source directory to build util/encodings.so"; + }); else print "***********************************" print("util/encodings couldn't be loaded. Check that you have a recent version of libidn"); @@ -129,10 +130,11 @@ local hashes, err = softreq "util.hashes" if not hashes then if err:match("module '[^']*' not found") then - missingdep("util.hashes", { ["Windows"] = "Make sure you have hashes.dll from the Prosody distribution in util/"; - ["GNU/Linux"] = "Run './configure' and 'make' in the Prosody source directory to build util/hashes.so"; - }); - else + missingdep("util.hashes", { + ["Windows"] = "Make sure you have hashes.dll from the Prosody distribution in util/"; + ["GNU/Linux"] = "Run './configure' and 'make' in the Prosody source directory to build util/hashes.so"; + }); + else print "***********************************" print("util/hashes couldn't be loaded. Check that you have a recent version of OpenSSL (libcrypto in particular)"); print ""