Browse Source

[Fix] Fix loading of maps from UCL objects

tags/1.4.1
Vsevolod Stakhov 7 years ago
parent
commit
b519db32ad
2 changed files with 6 additions and 6 deletions
  1. 5
    5
      src/libutil/map.c
  2. 1
    1
      src/plugins/lua/mid.lua

+ 5
- 5
src/libutil/map.c View File

@@ -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;
}
}

+ 1
- 1
src/plugins/lua/mid.lua View File

@@ -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

Loading…
Cancel
Save