]> source.dussan.org Git - rspamd.git/commitdiff
Fix metas memoization in SA plugin
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 6 Feb 2016 03:04:52 +0000 (03:04 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 6 Feb 2016 03:05:41 +0000 (03:05 +0000)
src/plugins/lua/spamassassin.lua

index 37689c13fba2e80b951fd36e61dec31a19da6c26..f2d7a4c4ea07880596c0c0c6eed1f78efb2dccb8 100644 (file)
@@ -1206,13 +1206,16 @@ local function post_process()
       local meta_cb = function(task)
         local res = 0
         -- XXX: need to memoize result for better performance
-        if not task:get_symbol(k) then
+        local sym = task:get_symbol(k)
+        if not sym then
           if expression then
             res = expression:process(task)
           end
           if res > 0 then
             task:insert_result(k, res)
           end
+        else
+          res = 1
         end
 
         return res