mod_firewall/mod_firewall.lua
changeset 2104 cbd0095e9302
parent 2103 a8c701631d0b
child 2105 41a0a9db89ef
equal deleted inserted replaced
2103:a8c701631d0b 2104:cbd0095e9302
    78 		for field in what:gmatch("%a+") do
    78 		for field in what:gmatch("%a+") do
    79 			table.insert(defs, ("local current_%s = current_date_time.%s;"):format(field, field));
    79 			table.insert(defs, ("local current_%s = current_date_time.%s;"):format(field, field));
    80 		end
    80 		end
    81 		return table.concat(defs, " ");
    81 		return table.concat(defs, " ");
    82 	end, depends = { "date_time" }; };
    82 	end, depends = { "date_time" }; };
       
    83 	timestamp = { global_code = [[local get_time = require "socket".gettime]]; local_code = [[local current_timestamp = get_time()]]; };
    83 	throttle = {
    84 	throttle = {
    84 		global_code = function (throttle)
    85 		global_code = function (throttle)
    85 			assert(idsafe(throttle), "Invalid rate limit name: "..throttle);
    86 			assert(idsafe(throttle), "Invalid rate limit name: "..throttle);
    86 			assert(active_definitions.RATE[throttle], "Unknown rate limit: "..throttle);
    87 			assert(active_definitions.RATE[throttle], "Unknown rate limit: "..throttle);
    87 			return ("local throttle_%s = rates.%s;"):format(throttle, throttle);
    88 			return ("local throttle_%s = rates.%s;"):format(throttle, throttle);