* @param obj
* @return TRUE if there is no explicit disable in the object found
*/
-gboolean rspamd_config_is_enabled_from_ucl (struct rspamd_config *cfg,
+gboolean rspamd_config_is_enabled_from_ucl (rspamd_mempool_t *pool,
const ucl_object_t *obj);
/*
}
gboolean
-rspamd_config_is_enabled_from_ucl (struct rspamd_config *cfg,
+rspamd_config_is_enabled_from_ucl (rspamd_mempool_t *pool,
const ucl_object_t *obj)
{
{
}
else if (ret == -1) {
- msg_info_config ("wrong value for the `enabled` key");
+ msg_info_pool_check ("wrong value for the `enabled` key");
return FALSE;
}
/* Default return is TRUE here */
}
else if (ret == -1) {
- msg_info_config ("wrong value for the `disabled` key");
+ msg_info_pool_check ("wrong value for the `disabled` key");
return FALSE;
}
}
}
else {
- enabled = rspamd_config_is_enabled_from_ucl (cfg, conf);
+ enabled = rspamd_config_is_enabled_from_ucl (cfg->cfg_pool, conf);
if (!enabled) {
rspamd_plugins_table_push_elt (L,
return FALSE;
}
+ if (!rspamd_config_is_enabled_from_ucl (pool, obj)) {
+ /* Upstream is valid but disabled */
+ msg_info_pool_check("upstream %s is disabled",
+ ucl_object_lookup (obj, "name") ?
+ ucl_object_tostring(ucl_object_lookup (obj, "name")) :
+ ucl_object_key (obj));
+ return TRUE;
+ }
+
up = rspamd_mempool_alloc0 (pool, sizeof (*up));
elt = ucl_object_lookup (obj, "name");