From: Willy Tarreau Date: Mon, 10 Dec 2012 16:03:52 +0000 (+0100) Subject: BUG/MINOR: connection: remove a few synchronous calls to polling updates X-Git-Tag: v1.5-dev15~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d486ef5045dcaa24ae57b538082e9c9a80e7235f;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/connection.c b/src/connection.c index 4bb497ef29..519a8f9cad 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 5edeeee26d..72854571fd 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 9679e16902..1507dcc84f 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; }