Mercurial > prosody-modules
diff mod_firewall/conditions.lib.lua @ 971:53e158e44a44
mod_firewall: Add rate limiting capabilities, and keep zones and throttle objects in shared tables
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 06 Apr 2013 22:20:59 +0100 |
parents | f3b0ddeebd9d |
children | cec42f884475 |
line wrap: on
line diff
--- a/mod_firewall/conditions.lib.lua Sat Apr 06 21:47:46 2013 +0200 +++ b/mod_firewall/conditions.lib.lua Sat Apr 06 22:20:59 2013 +0100 @@ -170,4 +170,8 @@ return table.concat(conditions, " or "), { "time:hour,min" }; end +function condition_handlers.LIMIT(name) + return ("not throttle_%s:poll(1)"):format(name), { "throttle:"..name }; +end + return condition_handlers;