aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-02-14 17:28:41 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-02-14 17:28:41 +0000
commitc935e8b49174fd65d73d2a54cf690381003081c0 (patch)
tree69c1c4de8f49c149228868227ad9e16f61052f5b /src
parent557c870057a43e72983e7f03feedbfc150e0b138 (diff)
downloadrspamd-c935e8b49174fd65d73d2a54cf690381003081c0.tar.gz
rspamd-c935e8b49174fd65d73d2a54cf690381003081c0.zip
[Project] Unify cdb maps
Diffstat (limited to 'src')
-rw-r--r--src/libserver/logger/logger_private.h2
-rw-r--r--src/plugins/lua/multimap.lua28
2 files changed, 4 insertions, 26 deletions
diff --git a/src/libserver/logger/logger_private.h b/src/libserver/logger/logger_private.h
index 4b0dbfef5..5fc258914 100644
--- a/src/libserver/logger/logger_private.h
+++ b/src/libserver/logger/logger_private.h
@@ -16,6 +16,8 @@
#ifndef RSPAMD_LOGGER_PRIVATE_H
#define RSPAMD_LOGGER_PRIVATE_H
+#include "logger.h"
+
/* How much message should be repeated before it is count to be repeated one */
#define REPEATS_MIN 3
#define REPEATS_MAX 300
diff --git a/src/plugins/lua/multimap.lua b/src/plugins/lua/multimap.lua
index 3a53d24cb..876e96dc1 100644
--- a/src/plugins/lua/multimap.lua
+++ b/src/plugins/lua/multimap.lua
@@ -439,27 +439,7 @@ local function multimap_callback(task, rule)
local ret = false
- if r['cdb'] then
- if type(r.cdb) == 'string' then
- local rspamd_cdb = require "rspamd_cdb"
- local cdb = rspamd_cdb.create(r.cdb, task:get_ev_base())
-
- if not cdb then
- rspamd_logger.infox(task, 'cannot open cdb file %s', r.cdb)
-
- return false
- else
- r.cdb = cdb
- end
- end
- local srch = value
- if type(value) == 'userdata' then
- if value.class == 'rspamd{ip}' then
- srch = value:tostring()
- end
- end
- ret = r.cdb:lookup(srch)
- elseif r.redis_key then
+ if r.redis_key then
-- Deal with hash name here: it can be either plain string or a selector
if type(r.redis_key) == 'string' then
ret = multimap_query_redis(r.redis_key, task, value, callback)
@@ -1094,11 +1074,7 @@ local function add_multimap_rule(key, newrule)
newrule.selector = selector
end
end
- -- Check cdb flag
- if type(newrule['map']) == 'string' and string.find(newrule['map'], '^cdb://.*$') then
- newrule['cdb'] = newrule['map']
- ret = true
- elseif type(newrule['map']) == 'string' and
+ if type(newrule['map']) == 'string' and
string.find(newrule['map'], '^redis://.*$') then
if not redis_params then
rspamd_logger.infox(rspamd_config, 'no redis servers are specified, ' ..