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().
diff --git a/src/mux_h1.c b/src/mux_h1.c
index ebda92c..1a6bfb8 100644
--- a/src/mux_h1.c
+++ b/src/mux_h1.c
@@ -1836,6 +1836,9 @@
if (!b_data(&h1c->ibuf))
h1_release_buf(h1c, &h1c->ibuf);
+ if (h1m->state <= H1_MSG_LAST_LF)
+ goto out;
+
if (h1c->state < H1_CS_RUNNING) {
/* 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
@@ -1843,12 +1846,6 @@
*/
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) {
TRACE_DEVEL("request headers fully parsed, create and attach the SC", H1_EV_RX_DATA, h1c->conn, h1s);
BUG_ON(h1s_sc(h1s));
@@ -2988,6 +2985,10 @@
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);
}
+ 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);