diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-10-17 16:23:45 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-10-17 16:23:45 +0100 |
commit | ec65afa2eff32bf4ea72502a7d4d46d6340e779b (patch) | |
tree | db5d64819aa66856a7b718f60b7a6afa518df3fb /src/plugins/lua | |
parent | 5ba9ba75fc19c62ca36198b8e1998412ecebdc07 (diff) | |
download | rspamd-ec65afa2eff32bf4ea72502a7d4d46d6340e779b.tar.gz rspamd-ec65afa2eff32bf4ea72502a7d4d46d6340e779b.zip |
[Rework] Adopt plugins
Diffstat (limited to 'src/plugins/lua')
-rw-r--r-- | src/plugins/lua/antivirus.lua | 4 | ||||
-rw-r--r-- | src/plugins/lua/asn.lua | 6 | ||||
-rw-r--r-- | src/plugins/lua/dmarc.lua | 2 | ||||
-rw-r--r-- | src/plugins/lua/fann_scores.lua | 6 | ||||
-rw-r--r-- | src/plugins/lua/greylist.lua | 6 | ||||
-rw-r--r-- | src/plugins/lua/ip_score.lua | 4 | ||||
-rw-r--r-- | src/plugins/lua/multimap.lua | 2 | ||||
-rw-r--r-- | src/plugins/lua/mx_check.lua | 4 | ||||
-rw-r--r-- | src/plugins/lua/ratelimit.lua | 6 | ||||
-rw-r--r-- | src/plugins/lua/replies.lua | 4 | ||||
-rw-r--r-- | src/plugins/lua/settings.lua | 2 |
11 files changed, 23 insertions, 23 deletions
diff --git a/src/plugins/lua/antivirus.lua b/src/plugins/lua/antivirus.lua index 2ca43f8df..6dfadd027 100644 --- a/src/plugins/lua/antivirus.lua +++ b/src/plugins/lua/antivirus.lua @@ -137,7 +137,7 @@ local function need_av_check(task, rule) end local function check_av_cache(task, rule, fn) - local function redis_av_cb(task, err, data) + local function redis_av_cb(err, data) if data and type(data) == 'string' then -- Cached if data ~= 'OK' then @@ -172,7 +172,7 @@ end local function save_av_cache(task, rule, to_save) local key = task:get_digest() - local function redis_set_cb(task, err, data) + local function redis_set_cb(err, data) -- Do nothing if err then rspamd_logger.errx(task, 'failed to save virus cache for %s -> "%s": %s', diff --git a/src/plugins/lua/asn.lua b/src/plugins/lua/asn.lua index 2bb380edc..75d495d79 100644 --- a/src/plugins/lua/asn.lua +++ b/src/plugins/lua/asn.lua @@ -65,7 +65,7 @@ local function asn_check(task) if redis_params then local redis_key = options.key_prefix .. ip:to_string() local ret,conn,upstream - local function redis_asn_set_cb(task, err, data) + local function redis_asn_set_cb(err, data) if not err then upstream:ok() else @@ -101,13 +101,13 @@ local function asn_check(task) local function asn_check_cache(ip, continuation_func) local key = options.key_prefix .. ip:to_string() - local function redis_asn_get_cb(task, err, data) + local function redis_asn_get_cb(err, data) if err or not data or type(data[1]) ~= 'string' then continuation_func(ip) else asn_set(data[1], data[2], data[3]) -- Refresh key - local function redis_asn_expire_cb(task, err, data) + local function redis_asn_expire_cb(err, data) end local ret,_,_ = rspamd_redis_make_request(task, diff --git a/src/plugins/lua/dmarc.lua b/src/plugins/lua/dmarc.lua index 112865939..f160fd28c 100644 --- a/src/plugins/lua/dmarc.lua +++ b/src/plugins/lua/dmarc.lua @@ -92,7 +92,7 @@ local function dmarc_callback(task) return maybe_force_action('na') end - local function dmarc_report_cb(task, err, data) + local function dmarc_report_cb(err, data) if not err then rspamd_logger.infox(task, '<%1> dmarc report saved for %2', task:get_message_id(), from[1]['domain']) diff --git a/src/plugins/lua/fann_scores.lua b/src/plugins/lua/fann_scores.lua index d1564cd2e..6a63e2e6e 100644 --- a/src/plugins/lua/fann_scores.lua +++ b/src/plugins/lua/fann_scores.lua @@ -602,7 +602,7 @@ redis_params = rspamd_parse_redis_server('fann_scores') local function maybe_load_fann(task, continue_cb, call_if_fail) local function load_fann() - local function redis_fann_load_cb(task, err, data) + local function redis_fann_load_cb(err, data) if not err and type(data) == 'table' and type(data[2]) == 'string' then local version = tonumber(data[1]) local err,ann_data = rspamd_util.zstd_decompress(data[2]) @@ -653,7 +653,7 @@ local function maybe_load_fann(task, continue_cb, call_if_fail) end local function check_fann() - local function redis_fann_check_cb(task, err, data) + local function redis_fann_check_cb(err, data) if not err and type(data) == 'string' then local version = tonumber(data) @@ -737,7 +737,7 @@ local function create_fann() end local function save_fann(task, is_spam) - local function redis_fann_save_cb(task, err, data) + local function redis_fann_save_cb(err, data) if err then rspamd_logger.errx(task, "cannot save neural net to redis: %s", err) end diff --git a/src/plugins/lua/greylist.lua b/src/plugins/lua/greylist.lua index e8f94101c..35d69ec14 100644 --- a/src/plugins/lua/greylist.lua +++ b/src/plugins/lua/greylist.lua @@ -145,7 +145,7 @@ local function greylist_check(task) local hash_key = body_key .. meta_key local upstream - local function redis_set_cb(task, err, data) + local function redis_set_cb(err, data) if not err then upstream:ok() else @@ -154,7 +154,7 @@ local function greylist_check(task) end end - local function redis_get_cb(task, err, data) + local function redis_get_cb(err, data) local ret_body = false local greylisted_body = false local ret_meta = false @@ -240,7 +240,7 @@ local function greylist_set(task) local upstream, ret, conn local hash_key = body_key .. meta_key - local function redis_set_cb(task, err, data) + local function redis_set_cb(err, data) if not err then upstream:ok() else diff --git a/src/plugins/lua/ip_score.lua b/src/plugins/lua/ip_score.lua index 6cb9d1a1f..28cffe452 100644 --- a/src/plugins/lua/ip_score.lua +++ b/src/plugins/lua/ip_score.lua @@ -105,7 +105,7 @@ local ip_score_set = function(task) return old_score + score, new_total end - local score_set_cb = function(task, err, data) + local score_set_cb = function(err, data) if err then rspamd_logger.infox(task, 'got error while IP score changing: %1', err) end @@ -210,7 +210,7 @@ end local ip_score_check = function(task) local asn, country, ipnet = ip_score_get_task_vars(task) - local ip_score_redis_cb = function(task, err, data) + local ip_score_redis_cb = function(err, data) local function calculate_score(score) local parts = asn_re:split(score) local rep = tonumber(parts[1]) diff --git a/src/plugins/lua/multimap.lua b/src/plugins/lua/multimap.lua index 4e3286796..99295b138 100644 --- a/src/plugins/lua/multimap.lua +++ b/src/plugins/lua/multimap.lua @@ -317,7 +317,7 @@ local function multimap_callback(task, rule) return false end - local function redis_map_cb(task, err, data) + local function redis_map_cb(err, data) if not err and type(data) ~= 'userdata' then callback(data) end diff --git a/src/plugins/lua/mx_check.lua b/src/plugins/lua/mx_check.lua index cdd099754..fe085cab0 100644 --- a/src/plugins/lua/mx_check.lua +++ b/src/plugins/lua/mx_check.lua @@ -60,7 +60,7 @@ local function mx_check(task) if all(function(k, elt) return elt.checked end, mxes) then -- Save cache local key = settings.key_prefix .. mx_domain - local function redis_cache_cb(task, err, data) + local function redis_cache_cb(err, data) if err ~= nil then rspamd_logger.errx(task, 'redis_cache_cb received error: %1', err) return @@ -189,7 +189,7 @@ local function mx_check(task) forced = true }) else - local function redis_cache_get_cb(task, err, data) + local function redis_cache_get_cb(err, data) if err or type(data) ~= 'string' then local r = task:get_resolver() r:resolve('mx', { diff --git a/src/plugins/lua/ratelimit.lua b/src/plugins/lua/ratelimit.lua index 7a4d606de..7d6086c3b 100644 --- a/src/plugins/lua/ratelimit.lua +++ b/src/plugins/lua/ratelimit.lua @@ -207,7 +207,7 @@ local function check_limits(task, args) local key = fun.foldl(function(acc, k) return acc .. k[2] end, '', args) local ret,upstream --- Called when value is got from server - local function rate_get_cb(task, err, data) + local function rate_get_cb(err, data) if err then rspamd_logger.infox(task, 'got error while getting limit: %1', err) upstream:fail() @@ -309,7 +309,7 @@ local function set_limits(task, args) local key = fun.foldl(function(acc, k) return acc .. k[2] end, '', args) local ret, upstream - local function rate_set_cb(task, err, data) + local function rate_set_cb(err, data) if not err then upstream:ok() else @@ -317,7 +317,7 @@ local function set_limits(task, args) err, upstream:get_addr()) end end - local function rate_get_cb(task, err, data) + local function rate_get_cb(err, data) if err then rspamd_logger.infox(task, 'got error while setting limit: %1', err) upstream:fail() diff --git a/src/plugins/lua/replies.lua b/src/plugins/lua/replies.lua index 236cb5626..901595295 100644 --- a/src/plugins/lua/replies.lua +++ b/src/plugins/lua/replies.lua @@ -42,7 +42,7 @@ local function make_key(goop) end local function replies_check(task) - local function redis_get_cb(task, err, data) + local function redis_get_cb(err, data) if err ~= nil then rspamd_logger.errx('redis_get_cb received error: %1', err) return @@ -83,7 +83,7 @@ local function replies_check(task) end local function replies_set(task) - local function redis_set_cb(task, err, data) + local function redis_set_cb(err, data) if err ~=nil then rspamd_logger.errx('redis_set_cb received error: %1', err) end diff --git a/src/plugins/lua/settings.lua b/src/plugins/lua/settings.lua index 406385e78..2325f6781 100644 --- a/src/plugins/lua/settings.lua +++ b/src/plugins/lua/settings.lua @@ -528,7 +528,7 @@ local function gen_redis_callback(handler, id) return function(task) local key = handler(task) - local function redis_settings_cb(task, err, data) + local function redis_settings_cb(err, data) if not err and type(data) == 'string' then local ucl = require "ucl" local parser = ucl.parser() |