]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stream-int: use conn_get_{src,dst} in conn_si_send_proxy()
authorWilly Tarreau <w@1wt.eu>
Wed, 17 Jul 2019 09:40:51 +0000 (11:40 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 19 Jul 2019 11:50:09 +0000 (13:50 +0200)
These ones replace the previous conn_get_{from,to}_addr() used to wait
for the connection establishment before sending a LOCAL line. The
error handling was preserved.

src/stream_interface.c

index 9b9a8e9fac4e246c6cd03b0d02552ba06b67a71f..75e60ff60981edeb012a3c976834e5327925e60d 100644 (file)
@@ -381,12 +381,7 @@ int conn_si_send_proxy(struct connection *conn, unsigned int flag)
                        /* The target server expects a LOCAL line to be sent first. Retrieving
                         * local or remote addresses may fail until the connection is established.
                         */
-                       conn_get_from_addr(conn);
-                       if (!(conn->flags & CO_FL_ADDR_FROM_SET))
-                               goto out_wait;
-
-                       conn_get_to_addr(conn);
-                       if (!(conn->flags & CO_FL_ADDR_TO_SET))
+                       if (!conn_get_src(conn) || !conn_get_dst(conn))
                                goto out_wait;
 
                        ret = make_proxy_line(trash.area, trash.size,