]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Minor fixes
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 5 Jul 2019 17:46:17 +0000 (18:46 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 5 Jul 2019 17:46:17 +0000 (18:46 +0100)
lualib/lua_meta.lua
lualib/lua_settings.lua

index 316c71d3d0c073f9a91eb5ad679a67b3af65a568..984f5fec8d168a7cb05f08fdfa345d94a2d4effc 100644 (file)
@@ -503,6 +503,7 @@ end
 
 exports.rspamd_count_metatokens = rspamd_count_metatokens
 exports.count_metatokens = rspamd_count_metatokens
+exports.version = 1 -- MUST be increased on each change of metatokens
 
 exports.add_metafunction = function(tbl)
   local ret, err = meta_schema(tbl)
index b472386b5f6081a47d70e0fc12660d22d650dc0a..fb1a70217ed9ac641c9776dc26b565e2bb4edefe 100644 (file)
@@ -153,14 +153,7 @@ local function register_settings_cb()
     for _,set in pairs(known_ids) do
       set.symbols = lua_util.keys(fun.filter(function(_, v) return v end, set.symbols))
       table.sort(set.symbols)
-
-      -- Create digest from sorted symbols
-      local cr = require "rspamd_cryptobox_hash"
-      local h = cr.create()
-      for _,sym in ipairs(set.symbols) do
-        h:update(sym)
-      end
-      set.digest = h:base32()
+      set.digest = lua_util.table_digest(set.symbols)
     end
 
     post_init_performed = true
@@ -216,6 +209,7 @@ local function settings_by_id(id)
   return known_ids[id]
 end
 
+
 exports.settings_by_id = settings_by_id
 exports.all_settings = known_ids
 exports.all_symbols = all_symbols