]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-h2: Use the count value received from the SI in h2_rcv_buf()
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 14 May 2019 20:44:43 +0000 (22:44 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 28 May 2019 05:42:12 +0000 (07:42 +0200)
Now, the SI calls h2_rcv_buf() with the right count value. So we can rely on
it. Unlike the H1 multiplexer, it is fairly easier for the H2 multiplexer
because the HTX message already exists, we only transfer blocks from the H2S to
the channel. And this part is handled by htx_xfer_blks().

src/mux_h2.c

index b39896374d26e4ad3c8627e8dd1b35ab0069bc56..0a7c8ea060104c84688fc88cbaacff06ad3456e6 100644 (file)
@@ -5383,7 +5383,6 @@ static size_t h2_rcv_buf(struct conn_stream *cs, struct buffer *buf, size_t coun
 
        /* transfer possibly pending data to the upper layer */
        if (h2c->proxy->options2 & PR_O2_USE_HTX) {
-               /* in HTX mode we ignore the count argument */
                h2s_htx = htx_from_buf(&h2s->rxbuf);
                if (htx_is_empty(h2s_htx)) {
                        /* Here htx_to_buf() will set buffer data to 0 because
@@ -5395,12 +5394,6 @@ static size_t h2_rcv_buf(struct conn_stream *cs, struct buffer *buf, size_t coun
 
                ret = h2s_htx->data;
                buf_htx = htx_from_buf(buf);
-               count = htx_free_data_space(buf_htx);
-               if (flags & CO_RFL_KEEP_RSV) {
-                       if (count <= global.tune.maxrewrite)
-                               goto end;
-                       count -= global.tune.maxrewrite;
-               }
 
                htx_xfer_blks(buf_htx, h2s_htx, count, HTX_BLK_EOM);