From 2c04a5a03de50c62fc6520a3cdcd1bab2de794cf Mon Sep 17 00:00:00 2001 From: William Lallemand Date: Fri, 13 Aug 2021 15:21:12 +0200 Subject: [PATCH] MINOR: proxy: disable warnings for internal proxies The internal proxies should be part of the proxies list, because of this, the check_config_validity() fonction could emit warnings about these proxies. This patch disables 3 startup warnings for internal proxies: - "has no 'bind' directive" (this one was already ignored for the CLI frontend, but we made it generic instead) - "missing timeouts" - "log format ignored" --- src/cfgparse.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cfgparse.c b/src/cfgparse.c index fafe7f7f27..113e30d3cb 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -2554,7 +2554,7 @@ int check_config_validity() break; } - if (curproxy != global.cli_fe && (curproxy->cap & PR_CAP_FE) && LIST_ISEMPTY(&curproxy->conf.listeners)) { + if (!(curproxy->cap & PR_CAP_INT) && (curproxy->cap & PR_CAP_FE) && LIST_ISEMPTY(&curproxy->conf.listeners)) { ha_warning("%s '%s' has no 'bind' directive. Please declare it as a backend if this was intended.\n", proxy_type_str(curproxy), curproxy->id); err_code |= ERR_WARN; @@ -3115,7 +3115,7 @@ int check_config_validity() } else cfgerr += acl_find_targets(curproxy); - if ((curproxy->mode == PR_MODE_TCP || curproxy->mode == PR_MODE_HTTP) && + if (!(curproxy->cap & PR_CAP_INT) && (curproxy->mode == PR_MODE_TCP || curproxy->mode == PR_MODE_HTTP) && (((curproxy->cap & PR_CAP_FE) && !curproxy->timeout.client) || ((curproxy->cap & PR_CAP_BE) && (curproxy->srv) && (!curproxy->timeout.connect || @@ -3348,7 +3348,7 @@ int check_config_validity() if (curproxy->options & PR_O_LOGASAP) curproxy->to_log &= ~LW_BYTES; - if ((curproxy->mode == PR_MODE_TCP || curproxy->mode == PR_MODE_HTTP) && + if (!(curproxy->cap & PR_CAP_INT) && (curproxy->mode == PR_MODE_TCP || curproxy->mode == PR_MODE_HTTP) && (curproxy->cap & PR_CAP_FE) && LIST_ISEMPTY(&curproxy->logsrvs) && (!LIST_ISEMPTY(&curproxy->logformat) || !LIST_ISEMPTY(&curproxy->logformat_sd))) { ha_warning("log format ignored for %s '%s' since it has no log address.\n",