changeset 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
parents 9239893a2400
children b149ea428b81
files mod_firewall/definitions.lib.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
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;
+