BUG/MINOR: tcpcheck: Don't warn on unused rules if check option is after

When tcp-check or http-check rules are used, if the corresponding check option
(option tcp-check and option httpchk) is declared after the ruleset, a warning
is emitted about an unused check ruleset while there is no problem in reality.

This patch must be backported as far as 2.2.
This commit is contained in:
Christopher Faulet 2020-11-13 08:55:57 +01:00
parent c7ba91039a
commit c751b4508d

View File

@ -1599,6 +1599,7 @@ int proxy_parse_tcp_check_opt(char **args, int cur_arg, struct proxy *curpx, str
free_tcpcheck_vars(&rules->preset_vars);
rules->list = &rs->rules;
rules->flags |= TCPCHK_RULES_TCP_CHK;
rules->flags &= ~TCPCHK_RULES_UNUSED_TCP_RS;
out:
return err_code;
@ -2621,6 +2622,7 @@ int proxy_parse_httpchk_opt(char **args, int cur_arg, struct proxy *curpx, struc
rules->list = &rs->rules;
rules->flags |= TCPCHK_RULES_HTTP_CHK;
rules->flags &= ~TCPCHK_RULES_UNUSED_HTTP_RS;
if (!tcpcheck_add_http_rule(chk, rules, &errmsg)) {
ha_alert("parsing [%s:%d] : '%s %s' : %s.\n", file, line, args[0], args[1], errmsg);
rules->list = NULL;