]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: connection: conn->xprt is never NULL
authorWilly Tarreau <w@1wt.eu>
Thu, 28 Nov 2019 17:08:49 +0000 (18:08 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 27 Dec 2019 13:04:33 +0000 (14:04 +0100)
Let's remove this outdated test that's been there since 1.5. For quite
some time now xprt hasn't been NULL anymore on an initialized connection.

src/connection.c

index 320a387d7f06e0cd6684004b6fec72b3e5e66147..6c8855fd532856e104ede9a39c24e74737d2ad09 100644 (file)
@@ -71,7 +71,7 @@ void conn_fd_handler(int fd)
            conn->xprt_done_cb && conn->xprt_done_cb(conn) < 0)
                return;
 
-       if (conn->xprt && fd_send_ready(fd) && fd_send_active(fd)) {
+       if (fd_send_ready(fd) && fd_send_active(fd)) {
                /* force reporting of activity by clearing the previous flags :
                 * we'll have at least ERROR or CONNECTED at the end of an I/O,
                 * both of which will be detected below.
@@ -99,7 +99,7 @@ void conn_fd_handler(int fd)
         * that we must absolutely test conn->xprt at each step in case it suddenly
         * changes due to a quick unexpected close().
         */
-       if (conn->xprt && fd_recv_ready(fd) && fd_recv_active(fd)) {
+       if (fd_recv_ready(fd) && fd_recv_active(fd)) {
                /* force reporting of activity by clearing the previous flags :
                 * we'll have at least ERROR or CONNECTED at the end of an I/O,
                 * both of which will be detected below.