]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Arc: Improve failure logging
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 25 Sep 2020 19:39:48 +0000 (20:39 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 25 Sep 2020 19:39:48 +0000 (20:39 +0100)
src/plugins/lua/arc.lua

index dc10476d7cc28bbe5f243fdfe5c0d6c52553b5d7..9811e43575105315cf686365970f9b02e8c042ab 100644 (file)
@@ -131,15 +131,17 @@ end
 local function arc_validate_seals(task, seals, sigs, seal_headers, sig_headers)
   for i = 1,#seals do
     if (sigs[i].i or 0) ~= i then
-      rspamd_logger.infox(task, 'bad i value for signature: %s, expected %s',
-        sigs[i].i, i)
-      task:insert_result(arc_symbols['invalid'], 1.0, 'invalid count of seals and signatures')
+      local fail_reason = string.format('bad i for signature: %d, expected %d; d=%s',
+          sigs[i].i, i, sigs[i].d)
+      rspamd_logger.infox(task, fail_reason)
+      task:insert_result(arc_symbols['invalid'], 1.0, fail_reason)
       return false
     end
     if (seals[i].i or 0) ~= i then
-      rspamd_logger.infox(task, 'bad i value for seal: %s, expected %s',
-        seals[i].i, i)
-      task:insert_result(arc_symbols['invalid'], 1.0, 'invalid count of seals and signatures')
+      local fail_reason = string.format('bad i for seal: %d, expected %d; d=%s',
+          seals[i].i, i, seals[i].d)
+      rspamd_logger.infox(task, fail_reason)
+      task:insert_result(arc_symbols['invalid'], 1.0,fail_reason)
       return false
     end