summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faulet <cfaulet@haproxy.com>2021-01-21 17:45:45 +0100
committerChristopher Faulet <cfaulet@haproxy.com>2021-01-26 15:00:18 +0100
commit23d0b3b9cb92f21927231bc43f6c90e6654c456d (patch)
treebcd1ac5f218b4b03e506f42a487809da782a12fe
parent7d00d526035688e4fe2e6f2bd65c9df4caca6ee0 (diff)
downloadhaproxy-23d0b3b9cb92f21927231bc43f6c90e6654c456d.tar.gz
MINOR: mux-h1: Wake up instead of subscribe for reads after H1C creation
When a H1 connection is created, we now wakeup the H1C tasklet instead of subscribing for reads. In addtion, it is now also performed if there are some data in the input buffer. This patch is required to fix the TCP to H1 upgrades.
-rw-r--r--src/mux_h1.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mux_h1.c b/src/mux_h1.c
index 5681a248f..bbb002496 100644
--- a/src/mux_h1.c
+++ b/src/mux_h1.c
@@ -812,8 +812,8 @@ static int h1_init(struct connection *conn, struct proxy *proxy, struct session
}
/* prepare to read something */
- if (h1_recv_allowed(h1c))
- h1c->conn->xprt->subscribe(h1c->conn, h1c->conn->xprt_ctx, SUB_RETRY_RECV, &h1c->wait_event);
+ if (h1_recv_allowed(h1c) || b_data(&h1c->ibuf))
+ tasklet_wakeup(h1c->wait_event.tasklet);
/* mux->wake will be called soon to complete the operation */
TRACE_LEAVE(H1_EV_H1C_NEW, conn, h1c->h1s);