From: Willy Tarreau Date: Wed, 25 Oct 2017 12:22:28 +0000 (+0200) Subject: MINOR: stream-int: stop checking for useless connection flags in chk_snd_conn X-Git-Tag: v1.8-rc1~231 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3b9c850271589751540b7eb0d9ae8816c38875c0;p=thirdparty%2Fhaproxy.git MINOR: stream-int: stop checking for useless connection flags in chk_snd_conn We've been keep this test for a connection being established since 1.5-dev14 when the stream-interface was still accessing the FD directly. The test on CO_FL_HANDSHAKE and L{4,6}_CONN is totally useless here, and can even be counter-productive on pure TCP where it could prevent a request from being sent on a connection still attempting to complete its establishment. And it creates an abnormal dependency between the layers that will complicate the implementation of the mux, so let's get rid of it now. --- diff --git a/src/stream_interface.c b/src/stream_interface.c index 7838372dc3..53b201c085 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -969,14 +969,12 @@ static void stream_int_chk_snd_conn(struct stream_interface *si) conn_refresh_polling_flags(conn); __conn_xprt_want_send(conn); - if (!(conn->flags & (CO_FL_HANDSHAKE|CO_FL_WAIT_L4_CONN|CO_FL_WAIT_L6_CONN))) { - si_conn_send(conn); - if (conn->flags & CO_FL_ERROR) { - /* Write error on the file descriptor */ - __conn_xprt_stop_both(conn); - si->flags |= SI_FL_ERR; - goto out_wakeup; - } + si_conn_send(conn); + if (conn->flags & CO_FL_ERROR) { + /* Write error on the file descriptor */ + __conn_xprt_stop_both(conn); + si->flags |= SI_FL_ERR; + goto out_wakeup; } /* OK, so now we know that some data might have been sent, and that we may