]> source.dussan.org Git - rspamd.git/commitdiff
Use local function in multimap.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 19 Nov 2013 00:48:59 +0000 (00:48 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 19 Nov 2013 00:48:59 +0000 (00:48 +0000)
src/plugins/lua/multimap.lua

index 455d5c61d7420c23366b0ff2fd8c72aa26dabbb4..faed356c450f7ce496ee251b6d340888cd50cd42 100644 (file)
@@ -54,7 +54,7 @@ local function multimap_rbl_cb(task, to_resolve, results, err)
        end
 end
 
-function check_multimap(task)
+local function check_multimap(task)
        for _,rule in pairs(rules) do
                if rule['type'] == 'ip' then
                        if rule['cdb'] then
@@ -321,10 +321,10 @@ if opts and type(opts) == 'table' then
        -- add fake symbol to check all maps inside a single callback
        if type(rspamd_config.get_api_version) ~= 'nil' then
                if rspamd_config.get_api_version() >= 4 then
-                       rspamd_config:register_callback_symbol_priority('MULTIMAP', 1.0, -1, 'check_multimap')
+                       rspamd_config:register_callback_symbol_priority('MULTIMAP', 1.0, -1, check_multimap)
                else
-                       rspamd_config:register_callback_symbol('MULTIMAP', 1.0, 'check_multimap')
+                       rspamd_config:register_callback_symbol('MULTIMAP', 1.0, check_multimap)
                end
        end
-       rspamd_config:register_symbol('MULTIMAP', 1.0, 'check_multimap')
+       rspamd_config:register_symbol('MULTIMAP', 1.0, check_multimap)
 end