diff --git a/src/mux_h2.c b/src/mux_h2.c index abc7e7c55..fe0a33690 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -5154,6 +5154,7 @@ static size_t h2s_frt_make_resp_data(struct h2s *h2s, struct buffer *buf, size_t struct htx_blk *blk; enum htx_blk_type type; int idx; + int trunc_out; /* non-zero if truncated on out buf */ TRACE_ENTER(H2_EV_TX_FRAME|H2_EV_TX_DATA, h2c->conn, h2s); @@ -5180,6 +5181,7 @@ static size_t h2s_frt_make_resp_data(struct h2s *h2s, struct buffer *buf, size_t type = htx_get_blk_type(blk); // DATA or EOM bsize = htx_get_blksz(blk); fsize = bsize; + trunc_out = 0; if (type == HTX_BLK_EOM) { if (h2s->flags & H2_SF_ES_SENT) { @@ -5342,6 +5344,7 @@ static size_t h2s_frt_make_resp_data(struct h2s *h2s, struct buffer *buf, size_t b_data(mbuf) <= MAX_DATA_REALIGN) goto realign_again; fsize = outbuf.size - 9; + trunc_out = 1; if (fsize <= 0) { /* no need to send an empty frame here */ @@ -5399,6 +5402,8 @@ static size_t h2s_frt_make_resp_data(struct h2s *h2s, struct buffer *buf, size_t } else { /* we've truncated this block */ htx_cut_data_blk(htx, blk, fsize); + if (trunc_out) + goto new_frame; } if (es_now) {