aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_map.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-04-21 12:37:58 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-04-21 12:37:58 +0100
commit7301151c6d6351e0bfe32947e153571f6ba8c22b (patch)
treefa2057f2da17f4e22ed71bf45bb69ee4836a2966 /src/lua/lua_map.c
parente6a60ab0da437564434969e0f3b63990c6aabbfa (diff)
downloadrspamd-7301151c6d6351e0bfe32947e153571f6ba8c22b.tar.gz
rspamd-7301151c6d6351e0bfe32947e153571f6ba8c22b.zip
[Feature] Add support of maps with multiple regexps matches
Diffstat (limited to 'src/lua/lua_map.c')
-rw-r--r--src/lua/lua_map.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lua/lua_map.c b/src/lua/lua_map.c
index 05eb1d007..c8130ede8 100644
--- a/src/lua/lua_map.c
+++ b/src/lua/lua_map.c
@@ -467,9 +467,9 @@ lua_config_add_map (lua_State *L)
map->type = RSPAMD_LUA_MAP_REGEXP;
if ((m = rspamd_map_add_from_ucl (cfg, map_obj, description,
- rspamd_regexp_list_read,
+ rspamd_regexp_list_read_single,
rspamd_regexp_list_fin,
- (void **)&map->data.re_map)) == NULL) {
+ (void **) &map->data.re_map)) == NULL) {
lua_pushnil (L);
ucl_object_unref (map_obj);
@@ -606,7 +606,8 @@ lua_map_get_key (lua_State * L)
key = lua_map_process_string_key (L, 2, &len);
if (key && map->data.re_map) {
- value = rspamd_match_regexp_map (map->data.re_map, key, len);
+ value = rspamd_match_regexp_map_single (map->data.re_map, key,
+ len);
if (value) {
lua_pushstring (L, value);