From: Olivier Houchard Date: Thu, 6 Jun 2019 16:15:01 +0000 (+0200) Subject: BUG/MEDIUM: tcp: Make sure we keep the polling consistent in tcp_probe_connect. X-Git-Tag: v2.0-dev6~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7b3a79f6c42a9ae6673f6d30877e9b7c38858623;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: tcp: Make sure we keep the polling consistent in tcp_probe_connect. In tcp_probe_connect(), if the connection is still pending, do not disable want_recv, we don't have any business to do so, but explicitely use __conn_xprt_want_send(), otherwise the next time we'll reach tcp_probe_connect, fd_send_ready() would return 0 and we would never flag the connection as CO_FL_CONNECTED, which can lead to various problems, such as check not completing because they consider it is not connected yet. --- diff --git a/src/proto_tcp.c b/src/proto_tcp.c index c64e48cd5c..51d10a553d 100644 --- a/src/proto_tcp.c +++ b/src/proto_tcp.c @@ -691,7 +691,7 @@ int tcp_connect_probe(struct connection *conn) if (connect(fd, (const struct sockaddr *)addr, get_addr_len(addr)) == -1) { if (errno == EALREADY || errno == EINPROGRESS) { - __conn_xprt_stop_recv(conn); + __conn_xprt_want_send(conn); fd_cant_send(fd); return 0; }