From: Christopher Faulet Date: Thu, 21 Jan 2021 16:45:45 +0000 (+0100) Subject: MINOR: mux-h1: Wake up H1C after its creation if input buffer is not empty X-Git-Tag: v2.4-dev7~114 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d9ee788b7a3c1043fa66688267a8c1dc8e17084f;p=thirdparty%2Fhaproxy.git MINOR: mux-h1: Wake up H1C after its creation if input buffer is not empty When a H1 connection is created, we now wakeup the H1C tasklet if there are some data in the input buffer. If not we only subscribe for reads. This patch is required to fix the TCP to H1 upgrades. --- diff --git a/src/mux_h1.c b/src/mux_h1.c index 5681a248f7..69cc468264 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -812,7 +812,9 @@ static int h1_init(struct connection *conn, struct proxy *proxy, struct session } /* prepare to read something */ - if (h1_recv_allowed(h1c)) + if (b_data(&h1c->ibuf)) + tasklet_wakeup(h1c->wait_event.tasklet); + else if (h1_recv_allowed(h1c)) h1c->conn->xprt->subscribe(h1c->conn, h1c->conn->xprt_ctx, SUB_RETRY_RECV, &h1c->wait_event); /* mux->wake will be called soon to complete the operation */