From: Christopher Faulet Date: Tue, 22 Oct 2024 05:56:39 +0000 (+0200) Subject: BUG/MEDIUM: mux-h2: Remove H2S from send list if data are sent via 0-copy FF X-Git-Tag: v3.1-dev11~84 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ded28f6e5c210b49ede7edb25cd4b39163759366;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: mux-h2: Remove H2S from send list if data are sent via 0-copy FF When data are sent via the zero-copy data forwarding, in h2_done_ff, we must be sure to remove the H2 stream from the send list if something is send. It was only performed if no blocking condition was encountered. But we must also do it if something is sent. Otherwise the transfer may be blocked till timeout. This patch must be backported as far as 2.9. --- diff --git a/src/mux_h2.c b/src/mux_h2.c index 74fb367461..453282f1b7 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -7860,13 +7860,6 @@ static size_t h2_done_ff(struct stconn *sc) h2s->flags &= ~H2_SF_MORE_HTX_DATA; } - if (!(sd->iobuf.flags & IOBUF_FL_FF_BLOCKED) && - !(h2s->flags & H2_SF_BLK_SFCTL) && - !(h2s->flags & (H2_SF_WANT_SHUTR|H2_SF_WANT_SHUTW))) { - /* Ok we managed to send something, leave the send_list if we were still there */ - h2_remove_from_list(h2s); - } - if (!sd->iobuf.data) goto end; @@ -7901,6 +7894,13 @@ static size_t h2_done_ff(struct stconn *sc) if (!(sd->iobuf.flags & IOBUF_FL_INTERIM_FF)) h2s->flags &= ~H2_SF_NOTIFIED; + if ((total || !(sd->iobuf.flags & IOBUF_FL_FF_BLOCKED)) && + !(h2s->flags & H2_SF_BLK_SFCTL) && + !(h2s->flags & (H2_SF_WANT_SHUTR|H2_SF_WANT_SHUTW))) { + /* Ok we managed to send something, leave the send_list if we were still there */ + h2_remove_from_list(h2s); + } + TRACE_LEAVE(H2_EV_H2S_SEND|H2_EV_STRM_SEND, h2s->h2c->conn, h2s); return total; }