From e9f6e8e7f6fedb7758e395437c456d602497a2b1 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Tue, 17 Oct 2023 11:07:33 +0200 Subject: [PATCH] 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. --- src/mux_h1.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mux_h1.c b/src/mux_h1.c index 7405d907d..ee6ac06ed 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: