From 9e394d34e061dfeb01b590ce48911a6d717dfde5 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Wed, 30 Aug 2023 10:56:21 +0200 Subject: [PATCH] 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. --- src/stconn.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/stconn.c b/src/stconn.c index e4d876cc51..c30a8dddd5 100644 --- a/src/stconn.c +++ b/src/stconn.c @@ -1692,9 +1692,11 @@ static int sc_conn_send(struct stconn *sc) else { /* 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); - sc_ep_report_blocked_send(sc); - s->task->expire = tick_first(s->task->expire, sc_ep_snd_ex(sc)); - task_queue(s->task); + if (sc_state_in(sc->state, SC_SB_EST|SC_SB_DIS|SC_SB_CLO)) { + sc_ep_report_blocked_send(sc); + s->task->expire = tick_first(s->task->expire, sc_ep_snd_ex(sc)); + task_queue(s->task); + } } return did_send; -- 2.39.5