diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-06-11 12:07:26 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-06-11 12:07:26 +0100 |
commit | fdf0cf9941ced79fb57bc1f7cb334cca7204b37d (patch) | |
tree | c117772eb55aa066794801b14115b5dade919c54 | |
parent | 45a93b53b20a901db7cb2d473eb460083ae1e8a9 (diff) | |
download | rspamd-fdf0cf9941ced79fb57bc1f7cb334cca7204b37d.tar.gz rspamd-fdf0cf9941ced79fb57bc1f7cb334cca7204b37d.zip |
[Fix] Fix another race condition in arc checks
-rw-r--r-- | src/plugins/lua/arc.lua | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/plugins/lua/arc.lua b/src/plugins/lua/arc.lua index c61423176..2a6d101cd 100644 --- a/src/plugins/lua/arc.lua +++ b/src/plugins/lua/arc.lua @@ -261,6 +261,7 @@ local function arc_callback(task) end -- Now we can verify all signatures + local processed = 0 fun.each( function(sig) local ret,err = dkim_verify(task, sig.header, arc_signature_cb, 'arc-sign') @@ -268,16 +269,17 @@ local function arc_callback(task) if not ret then cbdata.res = 'fail' table.insert(cbdata.errors, string.format('sig:%s:%s', sig.d or '', err)) - cbdata.checked = cbdata.checked + 1 - rspamd_logger.debugm(N, task, 'checked arc sig %s: %s(%s), %s processed', + else + processed = processed + 1 + rspamd_logger.debugm(N, task, 'processed arc signature %s: %s(%s), %s processed', sig.d, ret, err, cbdata.checked) end end, cbdata.sigs) - if cbdata.checked ~= #arc_sig_headers then + if processed ~= #arc_sig_headers then task:insert_result(arc_symbols['reject'], 1.0, - rspamd_logger.slog('cannot verify %s of signatures: %s', - #arc_sig_headers - cbdata.checked, cbdata.errors)) + rspamd_logger.slog('cannot verify %s of %s signatures: %s', + #arc_sig_headers - processed, #arc_sig_headers, cbdata.errors)) end end |