MEDIUM: h1: Immediately try to read data for frontend
Some checks are pending
Contrib / build (push) Waiting to run
alpine/musl / gcc (push) Waiting to run
VTest / Generate Build Matrix (push) Waiting to run
VTest / (push) Blocked by required conditions
Windows / Windows, gcc, all features (push) Waiting to run

In h1_init(), if we're a frontend connection, immediately attempt to
read data, if the connection is ready, instead of just subscribing.
There may already be data available, at least if we're using 0RTT.

This may be backported up to 2.8 in a while, after 3.3 is released, so
that if it causes problem, we have a chance to hear about it.
This commit is contained in:
Olivier Houchard 2025-10-29 15:39:49 +00:00 committed by Olivier Houchard
parent c84c15d393
commit b3d6f44af8

View file

@ -1332,8 +1332,21 @@ static int h1_init(struct connection *conn, struct proxy *proxy, struct session
/* prepare to read something */
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);
else if (h1_recv_allowed(h1c)) {
if (!conn_is_back(conn)) {
/*
* We may have data immediately available,
* especially if we're using 0RTT.
*/
if (h1_recv(h1c))
tasklet_wakeup(h1c->wait_event.tasklet);
} else {
h1c->conn->xprt->subscribe(h1c->conn,
h1c->conn->xprt_ctx,
SUB_RETRY_RECV,
&h1c->wait_event);
}
}
if (!conn_is_back(conn))
proxy_inc_fe_cum_sess_ver_ctr(sess->listener, proxy, 1);