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.
This commit is contained in:
Willy Tarreau 2023-08-09 11:58:15 +02:00
parent 949371a00d
commit 5201b4abd1
1 changed files with 2 additions and 0 deletions

View File

@ -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: