Software /
code /
prosody-modules
Diff
mod_firewall/definitions.lib.lua @ 2131:ba42c8882026
mod_firewall: Fix another unprotected use of util.cache
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 18 Mar 2016 09:59:42 +0000 |
parent | 2130:9239893a2400 |
child | 2370:5fe483b73fd2 |
line wrap: on
line diff
--- a/mod_firewall/definitions.lib.lua Fri Mar 18 09:57:09 2016 +0000 +++ b/mod_firewall/definitions.lib.lua Fri Mar 18 09:59:42 2016 +0000 @@ -6,7 +6,6 @@ local set = require"util.set"; local new_throttle = require "util.throttle".create; -local new_cache = require "util.cache".new; local multirate_cache_size = module:get_option_number("firewall_multirate_cache_limit", 1000); @@ -39,7 +38,7 @@ end; multi = function () - local cache = new_cache(max_throttles, evict_only_unthrottled); + local cache = require "util.cache".new(max_throttles, evict_only_unthrottled); return { poll_on = function (_, key, amount) assert(key, "no key"); @@ -59,3 +58,4 @@ end return definition_handlers; +