BUG/MINOR: stconn: Don't report blocked sends during connection establishment

The server timeout must not be handled during the connection establishment
to not superseed the connect timeout. To do so, we must not consider
outgoing data are blocked during this stage. Concretly, it means the fsb
time must not be updated during connection establishment.

It is not an issue with regular clients because the server timeout is only
defined when the connection is estalished. However, it may be an issue for the
HTTP client, when the server timeout is lower than the connect timeout. In this
case, an early 502 may be reported with no connection retries.

This patch must be backported to 2.8.
This commit is contained in:
Christopher Faulet 2023-08-30 10:56:21 +02:00
parent 3479d99d5f
commit 9e394d34e0

View File

@ -1692,9 +1692,11 @@ static int sc_conn_send(struct stconn *sc)
else { else {
/* We couldn't send all of our data, let the mux know we'd like to send more */ /* We couldn't send all of our data, let the mux know we'd like to send more */
conn->mux->subscribe(sc, SUB_RETRY_SEND, &sc->wait_event); conn->mux->subscribe(sc, SUB_RETRY_SEND, &sc->wait_event);
sc_ep_report_blocked_send(sc); if (sc_state_in(sc->state, SC_SB_EST|SC_SB_DIS|SC_SB_CLO)) {
s->task->expire = tick_first(s->task->expire, sc_ep_snd_ex(sc)); sc_ep_report_blocked_send(sc);
task_queue(s->task); s->task->expire = tick_first(s->task->expire, sc_ep_snd_ex(sc));
task_queue(s->task);
}
} }
return did_send; return did_send;