From: Christopher Faulet Date: Tue, 14 May 2019 20:44:43 +0000 (+0200) Subject: MINOR: mux-h2: Use the count value received from the SI in h2_rcv_buf() X-Git-Tag: v2.0-dev5~44 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8a9ad4c0e80e3d35d4ea5520dc4a167581f04104;p=thirdparty%2Fhaproxy.git MINOR: mux-h2: Use the count value received from the SI in h2_rcv_buf() 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(). --- diff --git a/src/mux_h2.c b/src/mux_h2.c index b39896374d..0a7c8ea060 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -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);