From: Christopher Faulet Date: Tue, 17 Oct 2023 09:07:33 +0000 (+0200) Subject: BUG/MEDIUM: mux-h1: do not forget TLR/EOT even when no data is sent X-Git-Tag: v2.9-dev8~45 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e9f6e8e7f6fedb7758e395437c456d602497a2b1;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: mux-h1: do not forget TLR/EOT even when no data is sent Since commit 723c73f8a ("MEDIUM: mux-h1: Split h1_process_mux() to make code more readable"), outgoing H1 chunked messages with no data at all get delayed by 200ms. It is due to the fact that we end processing too early and we don't have the opportunity to process trailers in this case. This fix addresses it by verifying if it's required to emit EOT or trailers, if any, when retruning from h1_make_data() No backport is needed, this was in 2.9-dev. --- diff --git a/src/mux_h1.c b/src/mux_h1.c index 7405d907d9..ee6ac06eda 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -3016,6 +3016,8 @@ static size_t h1_process_mux(struct h1c *h1c, struct buffer *buf, size_t count) ret = h1_make_data(h1s, h1m, buf, count); if (ret > 0) htx = htx_from_buf(buf); + if (unlikely(h1m->state == H1_MSG_TRAILERS)) // in case of no data + ret += h1_make_trailers(h1s, h1m, htx, count); break; case H1_MSG_TUNNEL: