mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-24 07:37:53 -04:00
MEDIUM: h1: Immediately try to read data for frontend
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:
parent
c84c15d393
commit
b3d6f44af8
1 changed files with 15 additions and 2 deletions
17
src/mux_h1.c
17
src/mux_h1.c
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue