From: Christopher Faulet Date: Wed, 30 Aug 2023 08:56:21 +0000 (+0200) Subject: BUG/MINOR: stconn: Don't report blocked sends during connection establishment X-Git-Tag: v2.9-dev5~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e394d34e0;p=thirdparty%2Fhaproxy.git 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. --- 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;