]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: mux-h1: do not forget TLR/EOT even when no data is sent
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 17 Oct 2023 09:07:33 +0000 (11:07 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 17 Oct 2023 16:11:04 +0000 (18:11 +0200)
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

index 7405d907d97685d1684d10497c9e6f033125d9f3..ee6ac06edaa5ab53f619fdb1dd51f5168c2770b8 100644 (file)
@@ -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: