From: Willy Tarreau Date: Wed, 4 Mar 2020 15:38:00 +0000 (+0100) Subject: MINOR: tcp/uxst/sockpair: only ask for I/O when really waiting for a connect() X-Git-Tag: v2.2-dev4~72 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4c69cff43832ebbb41325688145cfb986ad211f6;p=thirdparty%2Fhaproxy.git MINOR: tcp/uxst/sockpair: only ask for I/O when really waiting for a connect() Now that the stream-interface properly handles synchonous connects, there is no more reason for subscribing and doing nothing. --- diff --git a/src/proto_sockpair.c b/src/proto_sockpair.c index 75cdfd4979..fdbc81d1fe 100644 --- a/src/proto_sockpair.c +++ b/src/proto_sockpair.c @@ -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 */ } diff --git a/src/proto_tcp.c b/src/proto_tcp.c index 6f63e3f896..3629e19a55 100644 --- a/src/proto_tcp.c +++ b/src/proto_tcp.c @@ -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 */ } diff --git a/src/proto_uxst.c b/src/proto_uxst.c index 2d5ac71bce..256a58e563 100644 --- a/src/proto_uxst.c +++ b/src/proto_uxst.c @@ -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 */ }