]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: log: Properly test connection retries to fix dontlog-normal option
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 17 Jun 2022 12:53:20 +0000 (14:53 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 17 Jun 2022 12:53:21 +0000 (14:53 +0200)
The commit 731c8e6cf ("MINOR: stream: Simplify retries counter calculation")
introduced a regression. It broke the dontlog-normal option because the test
on the connection retries counter was not updated accordingly.

This patch should fix the issue #1754. It must be backported to 2.6.

src/log.c

index e25d2e79df480d49564555c0b584f28a6b3935f8..304e3cb6845c05e34add520780d7c283a9039700 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -3074,8 +3074,7 @@ void strm_log(struct stream *s)
        /* if we don't want to log normal traffic, return now */
        err = (s->flags & SF_REDISP) ||
               ((s->flags & SF_ERR_MASK) > SF_ERR_LOCAL) ||
-             (((s->flags & SF_ERR_MASK) == SF_ERR_NONE) &&
-              (s->conn_retries != s->be->conn_retries)) ||
+             (((s->flags & SF_ERR_MASK) == SF_ERR_NONE) && s->conn_retries) ||
              ((sess->fe->mode == PR_MODE_HTTP) && s->txn && s->txn->status >= 500);
 
        if (!err && (sess->fe->options2 & PR_O2_NOLOGNORM))