From 3b9c850271589751540b7eb0d9ae8816c38875c0 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 25 Oct 2017 14:22:28 +0200 Subject: [PATCH] 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. --- src/stream_interface.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/stream_interface.c b/src/stream_interface.c index 7838372dc..53b201c08 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