mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-27 13:51:00 +01:00
MINOR: mux-h1: Don't handle subscribe for reads in h1_process_demux()
When the request headers are not fully received, we must subscribe the H1 connection for reads to be able to receive more data. This was performed in h1_process_demux(). It is now perfoemd in h1_process_demux().
This commit is contained in:
parent
4e72b172d7
commit
2177d96acd
13
src/mux_h1.c
13
src/mux_h1.c
@ -1836,6 +1836,9 @@ static size_t h1_process_demux(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 (h1m->state <= H1_MSG_LAST_LF)
|
||||||
|
goto out;
|
||||||
|
|
||||||
if (h1c->state < H1_CS_RUNNING) {
|
if (h1c->state < H1_CS_RUNNING) {
|
||||||
/* The H1 connection is not ready. Most of time, there is no SC
|
/* The H1 connection is not ready. Most of time, there is no SC
|
||||||
* attached, except for TCP>H1 upgrade, from a TCP frontend. In both
|
* attached, except for TCP>H1 upgrade, from a TCP frontend. In both
|
||||||
@ -1843,12 +1846,6 @@ static size_t h1_process_demux(struct h1c *h1c, struct buffer *buf, size_t count
|
|||||||
*/
|
*/
|
||||||
BUG_ON(h1c->flags & H1C_F_IS_BACK);
|
BUG_ON(h1c->flags & H1C_F_IS_BACK);
|
||||||
|
|
||||||
if (h1m->state <= H1_MSG_LAST_LF) {
|
|
||||||
TRACE_STATE("Incomplete message, subscribing", H1_EV_RX_DATA|H1_EV_H1C_BLK|H1_EV_H1C_WAKE, h1c->conn, h1s);
|
|
||||||
h1c->conn->xprt->subscribe(h1c->conn, h1c->conn->xprt_ctx, SUB_RETRY_RECV, &h1c->wait_event);
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (h1c->state == H1_CS_EMBRYONIC) {
|
if (h1c->state == H1_CS_EMBRYONIC) {
|
||||||
TRACE_DEVEL("request headers fully parsed, create and attach the SC", H1_EV_RX_DATA, h1c->conn, h1s);
|
TRACE_DEVEL("request headers fully parsed, create and attach the SC", H1_EV_RX_DATA, h1c->conn, h1s);
|
||||||
BUG_ON(h1s_sc(h1s));
|
BUG_ON(h1s_sc(h1s));
|
||||||
@ -2988,6 +2985,10 @@ static int h1_process(struct h1c * h1c)
|
|||||||
h1c->flags = (h1c->flags & ~H1C_F_WAIT_NEXT_REQ) | H1C_F_ERROR;
|
h1c->flags = (h1c->flags & ~H1C_F_WAIT_NEXT_REQ) | H1C_F_ERROR;
|
||||||
TRACE_ERROR("parsing error detected", H1_EV_H1C_WAKE|H1_EV_H1C_ERR);
|
TRACE_ERROR("parsing error detected", H1_EV_H1C_WAKE|H1_EV_H1C_ERR);
|
||||||
}
|
}
|
||||||
|
else if (h1c->state < H1_CS_RUNNING) {
|
||||||
|
TRACE_STATE("Incomplete message, subscribing", H1_EV_RX_DATA|H1_EV_H1C_BLK|H1_EV_H1C_WAKE, h1c->conn, h1s);
|
||||||
|
h1c->conn->xprt->subscribe(h1c->conn, h1c->conn->xprt_ctx, SUB_RETRY_RECV, &h1c->wait_event);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
h1_send(h1c);
|
h1_send(h1c);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user