From: Christopher Faulet Date: Mon, 28 Sep 2026 17:11:14 +0000 (+0200) Subject: BUG/MINOR: flt_trace: consider tunneled data (RAW_DATA blocks) as data X-Git-Url: https://git.kaiwu.me/web/http/static/%7B@url%7D?a=commitdiff_plain;h=dffbd4598fe7ccb98c682b82c458f3047862428b;p=haproxy.git BUG/MINOR: flt_trace: consider tunneled data (RAW_DATA blocks) as data 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. --- diff --git a/src/flt_trace.c b/src/flt_trace.c index de75cdbc6..a51d92867 100644 --- a/src/flt_trace.c +++ b/src/flt_trace.c @@ -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);