]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: tcp/uxst/sockpair: only ask for I/O when really waiting for a connect()
authorWilly Tarreau <w@1wt.eu>
Wed, 4 Mar 2020 15:38:00 +0000 (16:38 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 4 Mar 2020 18:29:12 +0000 (19:29 +0100)
Now that the stream-interface properly handles synchonous connects, there
is no more reason for subscribing and doing nothing.

src/proto_sockpair.c
src/proto_tcp.c
src/proto_uxst.c

index 75cdfd49796a9d434952bcfd3355f9aad5cbaf6c..fdbc81d1fe239f5eef5b613ba664843580db55bc 100644 (file)
@@ -332,7 +332,6 @@ static int sockpair_connect_server(struct connection *conn, int flags)
                return SF_ERR_RESOURCE;
        }
 
-       fd_want_send(fd);  /* for connect status, proxy protocol or SSL */
        return SF_ERR_NONE;  /* connection is OK */
 }
 
index 6f63e3f8967697113ffa9e183ddfe0208c6e2bc4..3629e19a5557333bfc91b7dc3e1f9227d6ceb8a1 100644 (file)
@@ -576,8 +576,10 @@ int tcp_connect_server(struct connection *conn, int flags)
        conn_ctrl_init(conn);       /* registers the FD */
        fdtab[fd].linger_risk = 1;  /* close hard if needed */
 
-       if (conn->flags & CO_FL_WAIT_L4_CONN)
-               fd_cant_recv(fd); // we'll change this once the connection is validated
+       if (conn->flags & CO_FL_WAIT_L4_CONN) {
+               fd_want_send(fd);
+               fd_cant_send(fd);
+       }
 
        if (conn_xprt_init(conn) < 0) {
                conn_full_close(conn);
@@ -585,7 +587,6 @@ int tcp_connect_server(struct connection *conn, int flags)
                return SF_ERR_RESOURCE;
        }
 
-       fd_want_send(fd);  /* for connect status, proxy protocol or SSL */
        return SF_ERR_NONE;  /* connection is OK */
 }
 
index 2d5ac71bce45af4ac6b34bcea21e9881074b854e..256a58e5637680bb60b02b91e81688aa0d5c0eca 100644 (file)
@@ -578,8 +578,10 @@ static int uxst_connect_server(struct connection *conn, int flags)
        conn_ctrl_init(conn);       /* registers the FD */
        fdtab[fd].linger_risk = 0;  /* no need to disable lingering */
 
-       if (conn->flags & CO_FL_WAIT_L4_CONN)
-               fd_cant_recv(fd); // we'll change this once the connection is validated
+       if (conn->flags & CO_FL_WAIT_L4_CONN) {
+               fd_want_send(fd);
+               fd_cant_send(fd);
+       }
 
        if (conn_xprt_init(conn) < 0) {
                conn_full_close(conn);
@@ -587,7 +589,6 @@ static int uxst_connect_server(struct connection *conn, int flags)
                return SF_ERR_RESOURCE;
        }
 
-       fd_want_send(fd);  /* for connect status, proxy protocol or SSL */
        return SF_ERR_NONE;  /* connection is OK */
 }