]> git.kaiwu.me - haproxy.git/commitdiff
MINOR: mux-h1: Handle RAW_DATA blocks when sending data
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 15 Sep 2026 11:59:50 +0000 (13:59 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 18 Sep 2026 15:05:19 +0000 (17:05 +0200)
Tunneled data are now stored in RAW_DATA blocks. The H1 multiplexer must be
able to send them. h1_make_tunnel() is responsible to do so.

For the H1 multiplexer, there is no difference with HTTP data: both are sent
verbatim. Only the ability to handle the new type is added here. No producer
emits such block yet so h1_make_tunnel() relies on htx_is_data_type() for
now. But once all changes done, this will have to be modified to accept
RAW_DATA blocks only.

src/mux_h1.c

index 329f34a852ba94dfdd4778e8ded7615ecfec8bcd..63ba86fe4d533b47a0b399f96252e48184d46eaf 100644 (file)
@@ -3326,7 +3326,7 @@ static size_t h1_make_tunnel(struct h1s *h1s, struct h1m *h1m, struct buffer *bu
         */
        if (!b_data(&h1c->obuf) &&
            htx_nbblks(htx) == 1 &&
-           htx_get_blk_type(blk) == HTX_BLK_DATA &&
+           htx_is_data_type(htx_get_blk_type(blk)) &&
            htx_get_blksz(blk) == count &&
            b_size(&h1c->obuf) == b_size(buf)) {
                void *old_area;
@@ -3358,7 +3358,7 @@ static size_t h1_make_tunnel(struct h1s *h1s, struct h1m *h1m, struct buffer *bu
                sz = htx_get_blksz(blk);
                vlen = sz;
 
-               if (type == HTX_BLK_DATA) {
+               if (htx_is_data_type(type)) {
                        if (vlen > count) {
                                /* Get the maximum amount of data we can xferred */
                                vlen = count;