From: Christopher Faulet Date: Tue, 15 Sep 2026 12:00:08 +0000 (+0200) Subject: MINOR: mux-h2: Handle RAW_DATA blocks when sending data X-Git-Tag: v3.5-dev8~146 X-Git-Url: https://git.kaiwu.me/?a=commitdiff_plain;h=846e24be7c58ebb3679310e437efeb549326e65c;p=haproxy.git MINOR: mux-h2: Handle RAW_DATA blocks when sending data Tunneled data are now stored in RAW_DATA blocks. The H2 multiplexer must be able to send them, to be able to forward a tunnel established on the other side. For the H2 multiplexer, there is no difference with HTTP data: both are sent in DATA frames. Only the ability to handle the new type is added here. No producer emits such block yet. --- diff --git a/src/mux_h2.c b/src/mux_h2.c index 8c8f375ec..45284923b 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -7448,7 +7448,7 @@ static size_t h2s_make_data(struct h2s *h2s, struct buffer *buf, size_t count) bsize = htx_get_blksz(blk); fsize = bsize; trunc_out = 0; - if (type != HTX_BLK_DATA) + if (!htx_is_data_type(type)) goto end; mbuf = br_tail(h2c->mbuf); @@ -7487,7 +7487,7 @@ static size_t h2s_make_data(struct h2s *h2s, struct buffer *buf, size_t count) * from the HTX blocks. */ if (unlikely(fsize == count && b_size(mbuf) == b_size(buf) && - htx_nbblks(htx) == 1 && type == HTX_BLK_DATA && + htx_nbblks(htx) == 1 && htx_is_data_type(type) && fsize <= h2s_mws(h2s) && fsize <= h2c->mws && fsize <= h2c->mfs)) { void *old_area = mbuf->area; @@ -7726,7 +7726,7 @@ static size_t h2s_skip_data(struct h2s *h2s, struct buffer *buf, size_t count) type = htx_get_blk_type(blk); bsize = htx_get_blksz(blk); fsize = bsize; - if (type != HTX_BLK_DATA) + if (!htx_is_data_type(type)) goto end; if (fsize > count) @@ -8259,6 +8259,7 @@ static size_t h2_snd_buf(struct stconn *sc, struct buffer *buf, size_t count, in break; case HTX_BLK_DATA: + case HTX_BLK_RAW_DATA: /* all these cause the emission of a DATA frame (possibly empty) */ if (!(h2s->h2c->flags & H2_CF_IS_BACK) && (h2s->flags & (H2_SF_BODY_TUNNEL|H2_SF_BODYLESS_RESP)) == H2_SF_BODYLESS_RESP)