From d2236cdcc4a69edf976802bcfea43cd5125451e0 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Mon, 6 Apr 2020 18:29:14 +0200 Subject: [PATCH] MINOR: log: Don't systematically set LW_REQ when a sample expr is added When a log-format string is parsed, if a sample fetch is found, the flag LW_REQ is systematically added on the proxy. Unfortunately, this produce a warning during HAProxy start-up when a log-format string is used for a tcp-check send rule. Now this flag is only added if the parsed sample fetch depends on HTTP information. --- src/log.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/log.c b/src/log.c index 4f3c7c710..bacc04ed5 100644 --- a/src/log.c +++ b/src/log.c @@ -532,7 +532,8 @@ int add_sample_to_logformat_list(char *text, char *arg, int arg_len, struct prox * now on, but this will leave with sample capabilities soon. */ curpx->to_log |= LW_XPRT; - curpx->to_log |= LW_REQ; + if (curpx->http_needed) + curpx->to_log |= LW_REQ; LIST_ADDQ(list_format, &node->list); return 1;