diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-07-05 18:46:17 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-07-05 18:46:17 +0100 |
commit | 6ba7b6d32f6bde52b22c4e52381384495b52154a (patch) | |
tree | 410caf67c6431184ea0632d82ff8fb4369eeb882 | |
parent | 62f9156987d30770f5314041a6b0fb6c4383a460 (diff) | |
download | rspamd-6ba7b6d32f6bde52b22c4e52381384495b52154a.tar.gz rspamd-6ba7b6d32f6bde52b22c4e52381384495b52154a.zip |
[Minor] Minor fixes
-rw-r--r-- | lualib/lua_meta.lua | 1 | ||||
-rw-r--r-- | lualib/lua_settings.lua | 10 |
2 files changed, 3 insertions, 8 deletions
diff --git a/lualib/lua_meta.lua b/lualib/lua_meta.lua index 316c71d3d..984f5fec8 100644 --- a/lualib/lua_meta.lua +++ b/lualib/lua_meta.lua @@ -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) diff --git a/lualib/lua_settings.lua b/lualib/lua_settings.lua index b472386b5..fb1a70217 100644 --- a/lualib/lua_settings.lua +++ b/lualib/lua_settings.lua @@ -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 |