]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: stream: Remove bogus loop in conn_si_send_proxy
authorTim Duesterhus <tim@bastelstu.be>
Tue, 26 Feb 2019 16:09:51 +0000 (17:09 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 26 Feb 2019 16:27:04 +0000 (17:27 +0100)
The if-statement was converted into a while-loop in
7fe45698f58a53dda9182a5970a2ea4bda9f92fe to handle EINTR.

This special handling was later replaced in
0a03c0f022faf2773995fc8b9d14256c8a306e5a by conn_sock_send.

The while-loop was not changed back and is not unconditionally
exited after one iteration, with no `continue` inside the body.

Replace by an if-statement.

src/stream_interface.c

index 669a906ac279bcea4fe4f6a62525f76137c82517..e9fe00f6dc440adadffd00c2ec121ce53b88e883 100644 (file)
@@ -339,7 +339,7 @@ int conn_si_send_proxy(struct connection *conn, unsigned int flag)
         * connection, in which case the connection is validated only once
         * we've sent the whole proxy line. Otherwise we use connect().
         */
-       while (conn->send_proxy_ofs) {
+       if (conn->send_proxy_ofs) {
                const struct conn_stream *cs;
                int ret;
 
@@ -399,7 +399,6 @@ int conn_si_send_proxy(struct connection *conn, unsigned int flag)
                        goto out_wait;
 
                /* OK we've sent the whole line, we're connected */
-               break;
        }
 
        /* The connection is ready now, simply return and let the connection