diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-03-30 21:15:00 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-03-30 21:15:00 +0100 |
commit | e96512e68ba5268c76b2ebbee45d14bee423a6d3 (patch) | |
tree | 157bd26c027597d30a4c3d45ca1e47d9b15f8af9 /src/rspamd_proxy.c | |
parent | 987f56f4e2d9e7785f69a5a9068435881c80550d (diff) | |
download | rspamd-e96512e68ba5268c76b2ebbee45d14bee423a6d3.tar.gz rspamd-e96512e68ba5268c76b2ebbee45d14bee423a6d3.zip |
[Minor] Also allow to set objects to null for disabling
Diffstat (limited to 'src/rspamd_proxy.c')
-rw-r--r-- | src/rspamd_proxy.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/rspamd_proxy.c b/src/rspamd_proxy.c index d875c0efe..937a6af89 100644 --- a/src/rspamd_proxy.c +++ b/src/rspamd_proxy.c @@ -334,6 +334,12 @@ rspamd_proxy_parse_upstream (rspamd_mempool_t *pool, return FALSE; } + if (ucl_object_type (obj) != UCL_NULL) { + msg_info_pool_check("upstream %s is disabled by setting it to NULL", + ucl_object_key (obj)); + return TRUE; + } + if (!rspamd_config_is_enabled_from_ucl (pool, obj)) { /* Upstream is valid but disabled */ msg_info_pool_check("upstream %s is disabled", @@ -499,6 +505,12 @@ rspamd_proxy_parse_mirror (rspamd_mempool_t *pool, ctx = pd->user_struct; L = ctx->lua_state; + if (ucl_object_type (obj) != UCL_NULL) { + msg_info_pool_check("mirror %s is disabled by setting it to NULL", + ucl_object_key (obj)); + return TRUE; + } + if (ucl_object_type (obj) != UCL_OBJECT) { g_set_error (err, rspamd_proxy_quark (), 100, "mirror option must be an object"); @@ -508,7 +520,7 @@ rspamd_proxy_parse_mirror (rspamd_mempool_t *pool, if (!rspamd_config_is_enabled_from_ucl (pool, obj)) { /* Upstream is valid but disabled */ - msg_info_pool_check("upstream %s is disabled", + msg_info_pool_check("mirror %s is disabled", ucl_object_lookup (obj, "name") ? ucl_object_tostring(ucl_object_lookup (obj, "name")) : ucl_object_key (obj)); |