mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 22:01:31 +02:00
BUG/MAJOR: mux-h1: Don't pretend the input channel's buffer is full if empty
A regression was introduced by the commit 76014fd1 ("MEDIUM: h1-htx: Add HTX EOM block when the message is in H1_MSG_DONE state"). When nothing is copied in the channel's buffer when the input message is parsed, we erroneously pretend it is because there is not enough room by setting the CS_FL_WANT_ROOM flag on the conn-stream. This happens when a partial request is parsed. Because of this flag, we never try anymore to get input data from the mux because we first wait for more room in the channel's buffer, which is empty. Because of this bug, it is pretty easy to freeze a h1 connection. To fix the bug, we must obsiously set the CS_FL_WANT_ROOM flag only when there are still data to transfer while the channel's buffer is not empty. This patch must be backported if the patch 76014fd1 is backported too. So for now, no backport needed.
This commit is contained in:
parent
ca7a5af664
commit
6716cc2b93
@ -1483,7 +1483,7 @@ static size_t h1_process_input(struct h1c *h1c, struct buffer *buf, size_t count
|
|||||||
|
|
||||||
if (!b_data(&h1c->ibuf))
|
if (!b_data(&h1c->ibuf))
|
||||||
h1_release_buf(h1c, &h1c->ibuf);
|
h1_release_buf(h1c, &h1c->ibuf);
|
||||||
if (h1s_data_pending(h1s))
|
if (h1s_data_pending(h1s) && !htx_is_empty(htx))
|
||||||
h1s->cs->flags |= CS_FL_RCV_MORE | CS_FL_WANT_ROOM;
|
h1s->cs->flags |= CS_FL_RCV_MORE | CS_FL_WANT_ROOM;
|
||||||
else if (h1s->flags & H1S_F_REOS) {
|
else if (h1s->flags & H1S_F_REOS) {
|
||||||
h1s->cs->flags |= CS_FL_EOS;
|
h1s->cs->flags |= CS_FL_EOS;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user