]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: log: Dump good %B and %U values in logs
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 8 Dec 2025 13:52:59 +0000 (14:52 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 8 Dec 2025 14:22:01 +0000 (15:22 +0100)
When per-stream "bytes_in" and "bytes_out" counters where replaced in 3.3,
the wrong counters were used for %B and %U values in logs. In the
configuration manual and the commit message, it was specificed that
"bytes_in" was replaced by "req_in" and "bytes_out" by "res_in", but in the
code, wrong counters were used. It is now fixed.

This patch should fix the issue #3208. It must be backported to 3.3.

src/log.c

index 03d350564a3ebb906aee44dcf3899102e3efa050..3172ca861698200a00c1e9f33e1faa6ea81a11e3 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -4629,14 +4629,14 @@ int sess_build_logline_orig(struct session *sess, struct stream *s,
                        case LOG_FMT_BYTES: // %B
                                if (!(fe->to_log & LW_BYTES))
                                        LOGMETACHAR('+');
-                               ret = lf_int(tmplog, dst + maxsize - tmplog, logs->req_in, ctx, LF_INT_LLTOA);
+                               ret = lf_int(tmplog, dst + maxsize - tmplog, logs->res_in, ctx, LF_INT_LLTOA);
                                if (ret == NULL)
                                        goto out;
                                tmplog = ret;
                                break;
 
                        case LOG_FMT_BYTES_UP: // %U
-                               ret = lf_int(tmplog, dst + maxsize - tmplog, logs->res_out, ctx, LF_INT_LLTOA);
+                               ret = lf_int(tmplog, dst + maxsize - tmplog, logs->req_in, ctx, LF_INT_LLTOA);
                                if (ret == NULL)
                                        goto out;
                                tmplog = ret;