From b519db32ad4368e024ae413e151411ecd114c2fd Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 25 Nov 2016 16:30:57 +0000 Subject: [PATCH] [Fix] Fix loading of maps from UCL objects --- src/libutil/map.c | 10 +++++----- src/plugins/lua/mid.lua | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libutil/map.c b/src/libutil/map.c index 0ea3ce067..439a13e94 100644 --- a/src/libutil/map.c +++ b/src/libutil/map.c @@ -1592,7 +1592,7 @@ rspamd_map_add_from_ucl (struct rspamd_config *cfg, } if (map->backends->len == 0) { - msg_err_config ("map has no urls to be loaded"); + msg_err_config ("map has no urls to be loaded: empty list"); goto err; } } @@ -1619,11 +1619,11 @@ rspamd_map_add_from_ucl (struct rspamd_config *cfg, elt = ucl_object_lookup_any (obj, "upstreams", "url", "urls", NULL); if (elt == NULL) { - msg_err_config ("map has no urls to be loaded"); + msg_err_config ("map has no urls to be loaded: no elt"); goto err; } - if (ucl_object_type (obj) == UCL_ARRAY) { + if (ucl_object_type (elt) == UCL_ARRAY) { /* Add array of maps as multiple backends */ while ((cur = ucl_object_iterate (elt, &it, true)) != NULL) { if (ucl_object_type (cur) == UCL_STRING) { @@ -1645,7 +1645,7 @@ rspamd_map_add_from_ucl (struct rspamd_config *cfg, } if (map->backends->len == 0) { - msg_err_config ("map has no urls to be loaded"); + msg_err_config ("map has no urls to be loaded: empty object list"); goto err; } } @@ -1662,7 +1662,7 @@ rspamd_map_add_from_ucl (struct rspamd_config *cfg, } if (map->backends->len == 0) { - msg_err_config ("map has no urls to be loaded"); + msg_err_config ("map has no urls to be loaded: no valid backends"); goto err; } } diff --git a/src/plugins/lua/mid.lua b/src/plugins/lua/mid.lua index 8c4757880..0ca26b91f 100644 --- a/src/plugins/lua/mid.lua +++ b/src/plugins/lua/mid.lua @@ -90,6 +90,6 @@ if opts then rspamd_config:register_dependency(id, settings['symbol_dkim_allow']) else - rspamd_logger.infox(rspamd_config, 'url is not specified, disabling module') + rspamd_logger.infox(rspamd_config, 'source is not specified, disabling module') end end -- 2.39.5