commit d2a91c6: [Minor] Multimap: Add more debugging

Vsevolod Stakhov vsevolod at highsecure.ru
Thu Aug 22 16:21:06 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-08-22 17:18:45 +0100
URL: https://github.com/rspamd/rspamd/commit/d2a91c67f95d1ded1ff655f0d5416ed9ffe88225 (HEAD -> master)

[Minor] Multimap: Add more debugging

---
 src/plugins/lua/multimap.lua | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/plugins/lua/multimap.lua b/src/plugins/lua/multimap.lua
index f0f1ec719..da8ab01e3 100644
--- a/src/plugins/lua/multimap.lua
+++ b/src/plugins/lua/multimap.lua
@@ -624,11 +624,15 @@ local function multimap_callback(task, rule)
       end
     end
 
-    if r['filter'] or r['type'] == 'url' then
-      local fn = multimap_filters[r['type']]
+    if r.filter or r.type == 'url' then
+      local fn = multimap_filters[r.type]
 
       if fn then
-        value = fn(task, r['filter'], value, r)
+
+        local filtered_value = fn(task, r.filter, value, r)
+        lua_util.debugm(N, task, 'apply filter %s for rule %s: %s -> %s',
+            r.filter, r.symbol, value, filtered_value)
+        value = filtered_value
       end
     end
 


More information about the Commits mailing list