MEDIUM: connection: merge the send_proxy and local_send_proxy calls
We used to have two very similar functions for sending a PROXY protocol
line header. The reason is that the default one relies on the stream
interface to retrieve the other end's address, while the "local" one
performs a local address lookup and sends that instead (used by health
checks).
Now that the send_proxy_ofs is stored in the connection and not the
stream interface, we can make the local_send_proxy rely on it and
support partial sends. This also simplifies the code by removing the
local_send_proxy function, making health checks use send_proxy_ofs,
resulting in the removal of the CO_FL_LOCAL_SPROXY flag, and the
associated test in the connection handler. The other flag,
CO_FL_SI_SEND_PROXY was renamed without the "SI" part so that it
is clear that it is not dedicated anymore to a usage with a stream
interface.
diff --git a/src/proto_tcp.c b/src/proto_tcp.c
index 1f98445..6593ce1 100644
--- a/src/proto_tcp.c
+++ b/src/proto_tcp.c
@@ -472,7 +472,7 @@
/* Prepare to send a few handshakes related to the on-wire protocol. */
if (conn->send_proxy_ofs)
- conn->flags |= CO_FL_SI_SEND_PROXY;
+ conn->flags |= CO_FL_SEND_PROXY;
conn_ctrl_init(conn); /* registers the FD */
conn_sock_want_send(conn); /* for connect status */