]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: flt_trace: consider tunneled data (RAW_DATA blocks) as data
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 28 Sep 2026 17:11:14 +0000 (19:11 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 3 Dec 2026 12:41:06 +0000 (13:41 +0100)
Since tunneled data are stored in HTX_BLK_RAW_DATA blocks, the trace
filter's HTX helpers only considering HTX_BLK_DATA blocks ignore them:
nothing is hexdumped for tunneled data (e.g. websocket or CONNECT) and the
"random-forwarding" option is silently disabled for them since the data
length is found to be zero.

Let's use htx_is_data_type() to consider both block types.

Tunneled data are stored in HTX_BLK_RAW_DATA blocks since 3.5-dev8, so
this patch should be backported to 3.5.

src/flt_trace.c

index de75cdbc6703af0c248b52a0cdb5765aef605eba..a51d92867e7e25e61b89faa44121a269844d918a 100644 (file)
@@ -149,7 +149,7 @@ trace_htx_hexdump(struct htx *htx, unsigned int offset, unsigned int len)
 
                v = isttrim(v, len);
                len -= v.len;
-               if (type == HTX_BLK_DATA)
+               if (htx_is_data_type(type))
                        trace_hexdump(v);
        }
 }
@@ -162,12 +162,12 @@ trace_get_htx_datalen(struct htx *htx, unsigned int offset, unsigned int len)
        uint32_t data = 0;
 
        blk = htxret.blk;
-       if (blk && htxret.ret && htx_get_blk_type(blk) == HTX_BLK_DATA) {
+       if (blk && htxret.ret && htx_is_data_type(htx_get_blk_type(blk))) {
                data += htx_get_blksz(blk) - htxret.ret;
                blk = htx_get_next_blk(htx, blk);
        }
        while (blk) {
-               if (htx_get_blk_type(blk) != HTX_BLK_DATA)
+               if (!htx_is_data_type(htx_get_blk_type(blk)))
                        break;
                data += htx_get_blksz(blk);
                blk = htx_get_next_blk(htx, blk);