TT#14103 update upstream modules to 9b43b7fc3558

* refresh patches

Change-Id: Ia4892f7e913e208baf19b383a5728f8c9fbff078
changes/93/13193/1
Victor Seva 8 years ago
parent 23e737f82d
commit ef87c7b22b

@ -39,12 +39,10 @@ Change-Id: Ib79b6f2f60f71a80030bbd12b2eb893b60ac025d
plugins/mod_mam/mod_mam.lua | 2 ++
1 file changed, 2 insertions(+)
diff --git a/plugins/mod_mam/mod_mam.lua b/plugins/mod_mam/mod_mam.lua
index a4aa014..6d1a658 100644
--- a/plugins/mod_mam/mod_mam.lua
+++ b/plugins/mod_mam/mod_mam.lua
@@ -393,6 +393,8 @@ module:hook("message/bare", message_handler, 2);
module:hook("message/full", message_handler, 2);
@@ -393,6 +393,8 @@ module:hook("message/bare", message_hand
module:hook("message/full", message_handler, 0);
module:add_feature(xmlns_mam0); -- COMPAT with XEP-0313 v 0.1
+module:add_feature(xmlns_mam1); -- COMPAT with XEP-0313 v 0.5

@ -1,15 +1,19 @@
local mode = module:get_option_string("log_auth_ips", "failure");
assert(({ all = true, failure = true, success = true })[mode], "Unknown log mode: "..tostring(mode).." - valid modes are 'all', 'failure', 'success'");
assert(({ all = true, failure = true, success = true })[mode],
"Unknown log mode: "..tostring(mode).." - valid modes are 'all', 'failure', 'success'");
if mode == "failure" or mode == "all" then
module:hook("authentication-failure", function (event)
module:log("info", "Failed authentication attempt (%s) for user %s from IP: %s", event.condition or "unknown-condition", event.session.username or "?", event.session.ip or "?");
local session = event.session;
local username = session.username or session.sasl_handler and session.sasl_handler.username or "?";
session.log("info", "Failed authentication attempt (%s) for user %s from IP: %s",
event.condition or "unknown-condition", username, session.ip or "?");
end);
end
if mode == "success" or mode == "all" then
module:hook("authentication-success", function (event)
local session = event.session;
module:log("info", "Successful authentication as %s from IP: %s", session.username, session.ip or "?");
session.log("info", "Successful authentication as %s from IP: %s", session.username, session.ip or "?");
end);
end

@ -386,11 +386,11 @@ if cleanup_after ~= "never" then
end
-- Stanzas sent by local clients
module:hook("pre-message/bare", c2s_message_handler, 2);
module:hook("pre-message/full", c2s_message_handler, 2);
module:hook("pre-message/bare", c2s_message_handler, 0);
module:hook("pre-message/full", c2s_message_handler, 0);
-- Stanszas to local clients
module:hook("message/bare", message_handler, 2);
module:hook("message/full", message_handler, 2);
module:hook("message/bare", message_handler, 0);
module:hook("message/full", message_handler, 0);
module:add_feature(xmlns_mam0); -- COMPAT with XEP-0313 v 0.1

@ -49,8 +49,16 @@ local function init_session_cache(max_entries, evict_callback)
if not cache then
local store = {};
return {
get = function(user, key) return store[key]; end;
set = function(user, key, value) store[key] = value; end;
get = function(user, key)
if not user then return nil; end
if not key then return nil; end
return store[key];
end;
set = function(user, key, value)
if not user then return nil; end
if not key then return nil; end
store[key] = value;
end;
};
end
@ -58,12 +66,16 @@ local function init_session_cache(max_entries, evict_callback)
local stores = {};
return {
get = function(user, key)
if not user then return nil; end
if not key then return nil; end
if not stores[user] then
stores[user] = cache.new(max_entries, evict_callback);
end
return stores[user]:get(key);
end;
set = function(user, key, value)
if not user then return nil; end
if not key then return nil; end
if not stores[user] then stores[user] = cache.new(max_entries, evict_callback); end
stores[user]:set(key, value);
-- remove empty caches completely
@ -73,7 +85,7 @@ local function init_session_cache(max_entries, evict_callback)
end
local old_session_registry = init_session_cache(max_old_sessions, nil);
local session_registry = init_session_cache(max_hibernated_sessions, function(resumption_token, session)
if session.destroyed then return; end
if session.destroyed then return true; end -- destroyed session can always be removed from cache
session.log("warn", "User has too much hibernated sessions, removing oldest session (token: %s)", resumption_token);
-- store old session's h values on force delete
-- save only actual h value and username/host (for security)
@ -158,6 +170,8 @@ local function request_ack_if_needed(session, force)
end
end);
end
end
-- Trigger "smacks-ack-delayed"-event if we added new (ackable) stanzas to the outgoing queue
-- and there isn't already a timer for this event running.
-- If we wouldn't do this, stanzas added to the queue after the first "smacks-ack-delayed"-event
@ -166,7 +180,7 @@ local function request_ack_if_needed(session, force)
session.log("debug", "Calling delayed_ack_function directly (still waiting for ack)");
delayed_ack_function(session);
end
end
session.last_queue_count = #queue;
end

@ -1 +1 @@
2e1a4740adee
9b43b7fc3558

Loading…
Cancel
Save