From 61d1f2e0481cdbaa7367bb0448200000ff77439c Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Wed, 14 Apr 2010 12:59:46 +0100 Subject: configmanager: Add VirtualHost as an alias for Host --- core/configmanager.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core') diff --git a/core/configmanager.lua b/core/configmanager.lua index b974d2f2..6350d80b 100644 --- a/core/configmanager.lua +++ b/core/configmanager.lua @@ -103,7 +103,7 @@ do function parsers.lua.load(data, filename) local env; -- The ' = true' are needed so as not to set off __newindex when we assign the functions below - env = setmetatable({ Host = true; host = true; Component = true, component = true, + env = setmetatable({ Host = true, host = true, VirtualHost = true, Component = true, component = true, Include = true, include = true, RunScript = dofile }, { __index = function (t, k) return rawget(_G, k) or function (settings_table) @@ -115,7 +115,7 @@ do end}); rawset(env, "__currenthost", "*") -- Default is global - function env.Host(name) + function env.VirtualHost(name) if rawget(config, name) and rawget(config[name].core, "component_module") then error(format("Host %q clashes with previously defined %s Component %q, for services use a sub-domain like conference.%s", name, config[name].core.component_module:gsub("^%a+$", { component = "external", muc = "MUC"}), name, name), 0); @@ -124,7 +124,7 @@ do -- Needs at least one setting to logically exist :) set(name or "*", "core", "defined", true); end - env.host = env.Host; + env.Host, env.host = env.VirtualHost, env.VirtualHost; function env.Component(name) if rawget(config, name) and rawget(config[name].core, "defined") and not rawget(config[name].core, "component_module") then -- cgit v1.2.3 From 6d9cc727833025746953ae08357b44e62d140cf5 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Wed, 14 Apr 2010 13:00:24 +0100 Subject: hostmanager: Re-word log messages in line with config changes --- core/hostmanager.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core') diff --git a/core/hostmanager.lua b/core/hostmanager.lua index 445291d8..b549e6f7 100644 --- a/core/hostmanager.lua +++ b/core/hostmanager.lua @@ -43,7 +43,7 @@ local function load_enabled_hosts(config) end if not activated_any_host then - log("error", "No hosts defined in the config file. This may cause unexpected behaviour as no modules will be loaded."); + log("error", "No active VirtualHost entries in the config file. This may cause unexpected behaviour as no modules will be loaded."); end eventmanager.fire_event("hosts-activated", defined_hosts); @@ -60,8 +60,8 @@ function activate(host, host_config) and (configmanager.get(host, "core", "disallow_s2s") ~= false)) }; for option_name in pairs(host_config.core) do - if option_name:match("_ports$") then - log("warn", "%s: Option '%s' has no effect for virtual hosts - put it in global Host \"*\" instead", host, option_name); + if option_name:match("_ports$") or option_name:match("_interface$") then + log("warn", "%s: Option '%s' has no effect for virtual hosts - put it in the server-wide section instead", host, option_name); end end -- cgit v1.2.3 From daf1f01bda7e8a1ae3b6c6255d0cb31cc5b3b12f Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Mon, 19 Apr 2010 18:29:10 +0500 Subject: modulemanager: Log proper tracebacks on errors during module load/unload. --- core/modulemanager.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/modulemanager.lua b/core/modulemanager.lua index 5e9eaedd..8e62aecb 100644 --- a/core/modulemanager.lua +++ b/core/modulemanager.lua @@ -19,7 +19,7 @@ local pluginloader = require "util.pluginloader"; local hosts = hosts; local prosody = prosody; -local loadfile, pcall = loadfile, pcall; +local loadfile, pcall, xpcall = loadfile, pcall, xpcall; local setmetatable, setfenv, getfenv = setmetatable, setfenv, getfenv; local pairs, ipairs = pairs, ipairs; local t_insert, t_concat = table.insert, table.concat; @@ -29,6 +29,14 @@ local rawget = rawget; local error = error; local tostring, tonumber = tostring, tonumber; +local debug_traceback = debug.traceback; +local unpack, select = unpack, select; +pcall = function(f, ...) + local n = select("#", ...); + local params = {...}; + return xpcall(function() f(unpack(params, 1, n)) end, function(e) return tostring(e).."\n"..debug_traceback(); end); +end + local array, set = require "util.array", require "util.set"; local autoload_modules = {"presence", "message", "iq"}; -- cgit v1.2.3