From 5201b4abd16e453d4390f5ca19f34e33ddb5f3e0 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 9 Aug 2023 11:58:15 +0200 Subject: [PATCH] BUG/MEDIUM: mux-h1: do not forget EOH even when no header is sent Since commit 723c73f8a ("MEDIUM: mux-h1: Split h1_process_mux() to make code more readable"), outgoing H1 requests with no header at all (i.e. essentially HTTP/1.0 requests) get delayed by 200ms. Christopher found that it's due to the fact that we end processing too early and we don't have the opportunity to send the EOH in this case. This fix addresses it by verifying if it's required to emit EOH when retruning from h1_make_headers(). But maybe that block could be moved after the while loop in fact, or the stop condition in the loop be revisited not to stop of !htx_is_empty(). The current solution gets the job done at least. 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 2d84724fba..680c0baa75 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -2956,6 +2956,8 @@ static size_t h1_process_mux(struct h1c *h1c, struct buffer *buf, size_t count) case H1_MSG_HDR_NAME: ret = h1_make_headers(h1s, h1m, htx, count); + if (unlikely(h1m->state == H1_MSG_LAST_LF)) // in case of no header + ret += h1_make_eoh(h1s, h1m, htx, count); break; case H1_MSG_LAST_LF: -- 2.39.5