]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: log: Don't systematically set LW_REQ when a sample expr is added
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 6 Apr 2020 16:29:14 +0000 (18:29 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 27 Apr 2020 07:39:37 +0000 (09:39 +0200)
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

index 4f3c7c710af16bfc4ca516bf55318c48cc0caf7e..bacc04ed56c1255346f12e61f510272283456399 100644 (file)
--- 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;