]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stream-int: stop checking for useless connection flags in chk_snd_conn
authorWilly Tarreau <w@1wt.eu>
Wed, 25 Oct 2017 12:22:28 +0000 (14:22 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 25 Oct 2017 12:24:48 +0000 (14:24 +0200)
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

index 7838372dc345aa4ee5ba93a3a21b13f4d7d290f0..53b201c085f45501b4a9ac173b4c9f30e3ca4edc 100644 (file)
@@ -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