# HG changeset patch # User Matthew Wild # Date 1322279451 0 # Node ID 0317b01b6bcd90237234a470dfd4ffa902454396 # Parent ded726418b1658d0ffbbb7c5951b458c2b210364# Parent ae71ae5ddcfcb49df889cbb5841ace8840e03d02 Merge with Florob diff -r ded726418b16 -r 0317b01b6bcd core/loggingmanager.lua --- a/core/loggingmanager.lua Sun Nov 06 18:23:16 2011 +0100 +++ b/core/loggingmanager.lua Sat Nov 26 03:50:51 2011 +0000 @@ -41,7 +41,7 @@ local apply_sink_rules; local log_sink_types = setmetatable({}, { __newindex = function (t, k, v) rawset(t, k, v); apply_sink_rules(k); end; }); local get_levels; -local logging_levels = { "debug", "info", "warn", "error", "critical" } +local logging_levels = { "debug", "info", "warn", "error" } -- Put a rule into action. Requires that the sink type has already been registered. -- This function is called automatically when a new sink type is added [see apply_sink_rules()] diff -r ded726418b16 -r 0317b01b6bcd plugins/muc/muc.lib.lua --- a/plugins/muc/muc.lib.lua Sun Nov 06 18:23:16 2011 +0100 +++ b/plugins/muc/muc.lib.lua Sat Nov 26 03:50:51 2011 +0000 @@ -358,6 +358,7 @@ elseif type == "unavailable" then -- unavailable if current_nick then log("debug", "%s leaving %s", current_nick, room); + self._jid_nick[from] = nil; local occupant = self._occupants[current_nick]; local new_jid = next(occupant.sessions); if new_jid == from then new_jid = next(occupant.sessions, new_jid); end @@ -382,7 +383,6 @@ self:broadcast_presence(pr, from); self._occupants[current_nick] = nil; end - self._jid_nick[from] = nil; end elseif not type then -- available if current_nick then diff -r ded726418b16 -r 0317b01b6bcd util/dependencies.lua --- a/util/dependencies.lua Sun Nov 06 18:23:16 2011 +0100 +++ b/util/dependencies.lua Sat Nov 26 03:50:51 2011 +0000 @@ -136,6 +136,14 @@ log("error", "This version of LuaSec contains a known bug that causes disconnects, see http://prosody.im/doc/depends"); end end + if lxp then + if not pcall(lxp.new, { StartDoctypeDecl = false }) then + log("error", "The version of LuaExpat on your system leaves Prosody " + .."vulnerable to denial-of-service attacks. You should upgrade to " + .."LuaExpat 1.1.1 or higher as soon as possible. See " + .."http://prosody.im/doc/depends#luaexpat for more information."); + end + end end return _M; diff -r ded726418b16 -r 0317b01b6bcd util/xmppstream.lua --- a/util/xmppstream.lua Sun Nov 06 18:23:16 2011 +0100 +++ b/util/xmppstream.lua Sat Nov 26 03:50:51 2011 +0000 @@ -11,26 +11,16 @@ local st = require "util.stanza"; local stanza_mt = st.stanza_mt; +local error = error; local tostring = tostring; local t_insert = table.insert; local t_concat = table.concat; local t_remove = table.remove; local setmetatable = setmetatable; -local default_log = require "util.logger".init("xmppstream"); - -- COMPAT: w/LuaExpat 1.1.0 local lxp_supports_doctype = pcall(lxp.new, { StartDoctypeDecl = false }); -if not lxp_supports_doctype then - default_log("warn", "The version of LuaExpat on your system leaves Prosody " - .."vulnerable to denial-of-service attacks. You should upgrade to " - .."LuaExpat 1.1.1 or higher as soon as possible. See " - .."http://prosody.im/doc/depends#luaexpat for more information."); -end - -local error = error; - module "xmppstream" local new_parser = lxp.new; @@ -50,8 +40,6 @@ function new_sax_handlers(session, stream_callbacks) local xml_handlers = {}; - local log = session.log or default_log; - local cb_streamopened = stream_callbacks.streamopened; local cb_streamclosed = stream_callbacks.streamclosed; local cb_error = stream_callbacks.error or function(session, e) error("XML stream error: "..tostring(e)); end; @@ -188,7 +176,6 @@ local function set_session(stream, new_session) session = new_session; - log = new_session.log or default_log; end return xml_handlers, { reset = reset, set_session = set_session };