aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/cfg_rcl.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-07-27 16:00:40 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-07-27 16:00:40 +0100
commitf7f82c92b2fe906f3fb6337a54ffb04165e18350 (patch)
treedcf1af63972ab2cca65c2cc5e9075d732a790456 /src/libserver/cfg_rcl.c
parent4ace607202e5f90a7f654539ea7a671d59a107b1 (diff)
downloadrspamd-f7f82c92b2fe906f3fb6337a54ffb04165e18350.tar.gz
rspamd-f7f82c92b2fe906f3fb6337a54ffb04165e18350.zip
Support type alias for tokenizer.
Diffstat (limited to 'src/libserver/cfg_rcl.c')
-rw-r--r--src/libserver/cfg_rcl.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libserver/cfg_rcl.c b/src/libserver/cfg_rcl.c
index 13c5eb958..b7821b7bb 100644
--- a/src/libserver/cfg_rcl.c
+++ b/src/libserver/cfg_rcl.c
@@ -1044,6 +1044,7 @@ rspamd_rcl_classifier_handler (rspamd_mempool_t *pool,
}
else if (g_ascii_strcasecmp (key, "tokenizer") == 0) {
tkcf = rspamd_mempool_alloc0 (cfg->cfg_pool, sizeof (*tkcf));
+
if (ucl_object_type (val) == UCL_STRING) {
tkcf->name = ucl_object_tostring (val);
}
@@ -1053,6 +1054,13 @@ rspamd_rcl_classifier_handler (rspamd_mempool_t *pool,
tkcf->name = ucl_object_tostring (cur);
tkcf->opts = val;
}
+ else {
+ cur = ucl_object_find_key (val, "type");
+ if (cur != NULL) {
+ tkcf->name = ucl_object_tostring (cur);
+ tkcf->opts = val;
+ }
+ }
}
}
}