mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 14:21:25 +02:00
BUG/MINOR: mux-h1: Be sure to set CS_FL_WANT_ROOM when EOM can't be added
During the message parsing, when the HTX buffer is full and only the HTX EOM block cannot be added, it is important to notify the conn-stream that some processing must still be done but it is blocked because there is not enough room in the buffer. The way to do so is to set the CS_FL_WANT_ROOM flag on the conn-stream. Otherwise, because all data are received and consumed, the mux is not called anymore to add this last block, leaving the message unfinished from the HAProxy point of view. The only way to unblock it is to receive a shutdown for reads or to hit a timeout. This patch must be backported to 2.1 and 2.0. The 1.9 does not seem to be affected.
This commit is contained in:
parent
a45a8b5171
commit
7aae858001
@ -1279,9 +1279,14 @@ static size_t h1_process_data(struct h1s *h1s, struct h1m *h1m, struct htx **htx
|
|||||||
|
|
||||||
end:
|
end:
|
||||||
if (h1m->state == H1_MSG_DONE) {
|
if (h1m->state == H1_MSG_DONE) {
|
||||||
|
h1s->flags &= ~H1S_F_APPEND_EOM;
|
||||||
h1s->cs->flags |= CS_FL_EOI;
|
h1s->cs->flags |= CS_FL_EOI;
|
||||||
TRACE_STATE("end of message", H1_EV_RX_DATA|H1_EV_RX_BODY|H1_EV_RX_EOI, h1s->h1c->conn);
|
TRACE_STATE("end of message", H1_EV_RX_DATA|H1_EV_RX_BODY|H1_EV_RX_EOI, h1s->h1c->conn);
|
||||||
}
|
}
|
||||||
|
else if (h1m->state == H1_MSG_DATA && (h1m->flags & H1_MF_XFER_LEN) && h1m->curr_len == 0) {
|
||||||
|
h1s->flags |= H1S_F_APPEND_EOM;
|
||||||
|
TRACE_STATE("add append_eom", H1_EV_RX_DATA, h1s->h1c->conn);
|
||||||
|
}
|
||||||
|
|
||||||
TRACE_LEAVE(H1_EV_RX_DATA|H1_EV_RX_BODY, h1s->h1c->conn, h1s,, (size_t[]){ret});
|
TRACE_LEAVE(H1_EV_RX_DATA|H1_EV_RX_BODY, h1s->h1c->conn, h1s,, (size_t[]){ret});
|
||||||
return ret;
|
return ret;
|
||||||
@ -1473,7 +1478,8 @@ 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);
|
||||||
else if (h1s_data_pending(h1s) && !htx_is_empty(htx))
|
|
||||||
|
if ((h1s_data_pending(h1s) && !htx_is_empty(htx)) || (h1s->flags & H1S_F_APPEND_EOM))
|
||||||
h1s->cs->flags |= CS_FL_RCV_MORE | CS_FL_WANT_ROOM;
|
h1s->cs->flags |= CS_FL_RCV_MORE | CS_FL_WANT_ROOM;
|
||||||
|
|
||||||
if (((h1s->flags & (H1S_F_REOS|H1S_F_APPEND_EOM)) == H1S_F_REOS) &&
|
if (((h1s->flags & (H1S_F_REOS|H1S_F_APPEND_EOM)) == H1S_F_REOS) &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user