MINOR: connection: check for send_proxy during the connect(), not the SI
It's cleaner to check for a pending send_proxy_ofs while establishing
the connection (which already checks it anyway) and not in the stream
interface.
diff --git a/src/proto_tcp.c b/src/proto_tcp.c
index 1c55b6a..1f98445 100644
--- a/src/proto_tcp.c
+++ b/src/proto_tcp.c
@@ -257,6 +257,8 @@
* - 1 = delayed ACK if backend has tcp-smart-connect, regardless of data
* - 2 = delayed ACK regardless of backend options
*
+ * Note that a pending send_proxy message accounts for data.
+ *
* It can return one of :
* - SN_ERR_NONE if everything's OK
* - SN_ERR_SRVTO if there are no more servers
@@ -415,6 +417,9 @@
}
}
+ /* if a send_proxy is there, there are data */
+ data |= conn->send_proxy_ofs;
+
#if defined(TCP_QUICKACK)
/* disabling tcp quick ack now allows the first request to leave the
* machine with the first ACK. We only do this if there are pending
@@ -465,6 +470,10 @@
conn->flags = CO_FL_WAIT_L4_CONN; /* connection in progress */
conn->flags |= CO_FL_ADDR_TO_SET;
+ /* 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_ctrl_init(conn); /* registers the FD */
conn_sock_want_send(conn); /* for connect status */