# HG changeset patch # User Kim Alvefur # Date 1531922233 -7200 # Node ID 5c3f3f5a43774d1d14cfeb55f8e4fddf3809a24a # Parent 7c450c27d4bac6c31f391689ffe5e60e89f3454f Backed out parts of changeset a81456a13797 diff -r 7c450c27d4ba -r 5c3f3f5a4377 mod_auth_ldap/mod_auth_ldap.lua --- a/mod_auth_ldap/mod_auth_ldap.lua Fri Jul 13 14:38:40 2018 +0200 +++ b/mod_auth_ldap/mod_auth_ldap.lua Wed Jul 18 15:57:13 2018 +0200 @@ -35,18 +35,9 @@ local success, iterator, invariant, initial = pcall(ld[method], ld, ...); if not success then ld = nil; return nil, iterator, "search"; end - module:log("debug", "success = %s, invariant = %s", - tostring(success), - tostring(invariant)); - local success, dn, attr = pcall(iterator, invariant, initial); - module:log("debug", "success = %s, dn = %s, attr = %s", - tostring(success), - tostring(dn), - tostring(attr)); if not success then ld = nil; return success, dn, "iter"; end - return dn, attr, "return"; end diff -r 7c450c27d4ba -r 5c3f3f5a4377 mod_muc_limits/mod_muc_limits.lua --- a/mod_muc_limits/mod_muc_limits.lua Fri Jul 13 14:38:40 2018 +0200 +++ b/mod_muc_limits/mod_muc_limits.lua Wed Jul 18 15:57:13 2018 +0200 @@ -25,18 +25,6 @@ dropped_jids = nil; end -local function get_non_outcast_affiliations(room) - local nmembers = 0; - -- this is an evil hack, we probably should not access _affiliations - -- directly ... - for _, aff in pairs(room._affiliations) do - if aff ~= "outcast" then - nmembers = nmembers + 1; - end - end - return nmembers; -end - local function handle_stanza(event) local origin, stanza = event.origin, event.stanza; if stanza.name == "presence" and stanza.attr.type == "unavailable" then -- Don't limit room leaving @@ -61,15 +49,7 @@ throttle = new_throttle(period*burst, burst); room.throttle = throttle; end - - local cost = 1; - -- we scale the cost by the inverse of the square root of the number of - -- members; this should effectively raise the limit by a factor of - -- sqrt(nmembers) - local nmembers = math.max(get_non_outcast_affiliations(room), 1); - cost = cost / math.sqrt(nmembers); - - if not throttle:poll(cost) then + if not throttle:poll(1) then module:log("debug", "Dropping stanza for %s@%s from %s, over rate limit", dest_room, dest_host, from_jid); if not dropped_jids then dropped_jids = { [from_jid] = true, from_jid };