From d486ef5045dcaa24ae57b538082e9c9a80e7235f Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 10 Dec 2012 17:03:52 +0100 Subject: [PATCH] BUG/MINOR: connection: remove a few synchronous calls to polling updates There were a few synchronous calls to polling updates in some functions called from the connection handler. These ones are not needed and should be replaced by more efficient and more debugable asynchronous calls. --- src/connection.c | 4 ++-- src/proto_tcp.c | 6 +++--- src/stream_interface.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/connection.c b/src/connection.c index 4bb497ef2..519a8f9ca 100644 --- a/src/connection.c +++ b/src/connection.c @@ -284,7 +284,7 @@ int conn_recv_proxy(struct connection *conn, int flag) if (errno == EINTR) continue; if (errno == EAGAIN) { - conn_sock_poll_recv(conn); + __conn_sock_poll_recv(conn); return 0; } goto recv_abort; @@ -455,7 +455,7 @@ int conn_recv_proxy(struct connection *conn, int flag) goto fail; fail: - conn_sock_stop_both(conn); + __conn_sock_stop_both(conn); conn->flags |= CO_FL_ERROR; return 0; } diff --git a/src/proto_tcp.c b/src/proto_tcp.c index 5edeeee26..72854571f 100644 --- a/src/proto_tcp.c +++ b/src/proto_tcp.c @@ -520,8 +520,8 @@ int tcp_connect_probe(struct connection *conn) */ if (connect(fd, (struct sockaddr *)&conn->addr.to, get_addr_len(&conn->addr.to)) < 0) { if (errno == EALREADY || errno == EINPROGRESS) { - conn_sock_stop_recv(conn); - conn_sock_poll_send(conn); + __conn_sock_stop_recv(conn); + __conn_sock_poll_send(conn); return 0; } @@ -544,7 +544,7 @@ int tcp_connect_probe(struct connection *conn) */ conn->flags |= CO_FL_ERROR; - conn_sock_stop_both(conn); + __conn_sock_stop_both(conn); return 0; } diff --git a/src/stream_interface.c b/src/stream_interface.c index 9679e1690..1507dcc84 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -1035,7 +1035,7 @@ static void si_conn_recv_cb(struct connection *conn) } if ((chn->flags & CF_READ_DONTWAIT) || --read_poll <= 0) { - conn_data_stop_recv(conn); + __conn_data_stop_recv(conn); break; }