Software /
code /
prosody-modules
Comparison
mod_firewall/mod_firewall.lua @ 2130:9239893a2400
mod_firewall: Don't use util.cache unless it's needed, and add explanatory error if it is not available
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 18 Mar 2016 09:57:09 +0000 |
parent | 2128:21bc4d7cddae |
child | 2342:6848297cf40a |
comparison
equal
deleted
inserted
replaced
2129:26334f4a8eb9 | 2130:9239893a2400 |
---|---|
115 return ("local global_throttle_%s = rates.%s:single();"):format(throttle, throttle); | 115 return ("local global_throttle_%s = rates.%s:single();"):format(throttle, throttle); |
116 end; | 116 end; |
117 }; | 117 }; |
118 multithrottle = { | 118 multithrottle = { |
119 global_code = function (throttle) | 119 global_code = function (throttle) |
120 assert(pcall(require, "util.cache"), "Using LIMIT with 'on' requires Prosody 0.10 or higher"); | |
120 assert(idsafe(throttle), "Invalid rate limit name: "..throttle); | 121 assert(idsafe(throttle), "Invalid rate limit name: "..throttle); |
121 assert(active_definitions.RATE[throttle], "Unknown rate limit: "..throttle); | 122 assert(active_definitions.RATE[throttle], "Unknown rate limit: "..throttle); |
122 return ("local multi_throttle_%s = rates.%s:multi();"):format(throttle, throttle); | 123 return ("local multi_throttle_%s = rates.%s:multi();"):format(throttle, throttle); |
123 end; | 124 end; |
124 }; | 125 }; |