comparison mod_firewall/actions.lib.lua @ 2519:d4bc434a60a4

mod_firewall: Update functions that use meta() to allow functions with deps inside expressions
author Matthew Wild <mwild1@gmail.com>
date Sun, 19 Feb 2017 21:08:30 +0000
parents 07d7036040ee
children 9d2bfff515b8
comparison
equal deleted inserted replaced
2518:0e1054c19f9d 2519:d4bc434a60a4
156 end 156 end
157 157
158 function action_handlers.LOG(string) 158 function action_handlers.LOG(string)
159 local level = string:match("^%[(%a+)%]") or "info"; 159 local level = string:match("^%[(%a+)%]") or "info";
160 string = string:gsub("^%[%a+%] ?", ""); 160 string = string:gsub("^%[%a+%] ?", "");
161 return meta(("(session.log or log)(%q, %q);"):format(level, string)); 161 local meta_deps = {};
162 local code = meta(("(session.log or log)(%q, %q);"):format(level, string), meta_deps);
163 return code, meta_deps;
162 end 164 end
163 165
164 function action_handlers.RULEDEP(dep) 166 function action_handlers.RULEDEP(dep)
165 return "", { dep }; 167 return "", { dep };
166 end 168 end