diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2022-01-08 12:09:01 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2022-01-08 12:09:01 +0000 |
commit | 9473ed82b5011b67646c18d9f3fb8da67f01e038 (patch) | |
tree | 35d1e663cbd87ed1769d9ad4ae7556d96ea15022 /src/plugins/lua/arc.lua | |
parent | 0a738590ef6acd91670406cfafc017fbef0c8d8a (diff) | |
download | rspamd-9473ed82b5011b67646c18d9f3fb8da67f01e038.tar.gz rspamd-9473ed82b5011b67646c18d9f3fb8da67f01e038.zip |
[Minor] Arc: Rename bogus variable
Diffstat (limited to 'src/plugins/lua/arc.lua')
-rw-r--r-- | src/plugins/lua/arc.lua | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/plugins/lua/arc.lua b/src/plugins/lua/arc.lua index b73dc89e4..39e33c7c0 100644 --- a/src/plugins/lua/arc.lua +++ b/src/plugins/lua/arc.lua @@ -176,7 +176,7 @@ local function arc_callback(task) local cbdata = { seals = {}, sigs = {}, - checked = 0, + cur_arc_id = 0, res = 'success', errors = {}, allowed_by_trusted = false @@ -222,9 +222,9 @@ local function arc_callback(task) local function gen_arc_seal_cb(sig) return function (_, res, err, domain) - cbdata.checked = cbdata.checked + 1 + cbdata.cur_arc_id = cbdata.cur_arc_id + 1 lua_util.debugm(N, task, 'checked arc seal: %s(%s), %s processed', - res, err, cbdata.checked) + res, err, cbdata.cur_arc_id) if not res then cbdata.res = 'fail' @@ -237,14 +237,14 @@ local function arc_callback(task) if settings.whitelisted_signers_map:get_key(sig.d) then -- Whitelisted signer has been found in a valid chain task:insert_result(arc_symbols.trusted_allow, 1.0, - string.format('%s:s=%s:i=%d', domain, sig.s, cbdata.checked)) + string.format('%s:s=%s:i=%d', domain, sig.s, cbdata.cur_arc_id)) end end - if cbdata.checked == #arc_sig_headers then + if cbdata.cur_arc_id == #arc_sig_headers then if cbdata.res == 'success' then local arc_allow_result = string.format('%s:s=%s:i=%d', - domain, sig.s, cbdata.checked) + domain, sig.s, cbdata.cur_arc_id) task:insert_result(arc_symbols.allow, 1.0, arc_allow_result) task:cache_set('arc-allow', arc_allow_result) else @@ -258,7 +258,7 @@ local function arc_callback(task) local function arc_signature_cb(_, res, err, domain) lua_util.debugm(N, task, 'checked arc signature %s: %s(%s), %s processed', - domain, res, err, cbdata.checked) + domain, res, err, cbdata.cur_arc_id) if not res then cbdata.res = 'fail' @@ -268,7 +268,7 @@ local function arc_callback(task) end if cbdata.res == 'success' then -- Verify seals - cbdata.checked = 0 + cbdata.cur_arc_id = 0 fun.each( function(sig) local ret, lerr = dkim_verify(task, sig.header, gen_arc_seal_cb(sig), 'arc-seal') @@ -276,9 +276,9 @@ local function arc_callback(task) cbdata.res = 'fail' table.insert(cbdata.errors, string.format('seal:%s:s=%s:i=%s:%s', sig.d or '', sig.s or '', sig.i or '', lerr)) - cbdata.checked = cbdata.checked + 1 + cbdata.cur_arc_id = cbdata.cur_arc_id + 1 lua_util.debugm(N, task, 'checked arc seal %s: %s(%s), %s processed', - sig.d, ret, lerr, cbdata.checked) + sig.d, ret, lerr, cbdata.cur_arc_id) end end, cbdata.seals) else @@ -340,7 +340,7 @@ local function arc_callback(task) else processed = processed + 1 lua_util.debugm(N, task, 'processed arc signature %s[%s]: %s(%s), %s processed', - sig.d, sig.i, ret, err, cbdata.checked) + sig.d, sig.i, ret, err, cbdata.cur_arc_id) end if processed == 0 then |