]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: connection: merge CO_FL_NOTIFY_DATA and CO_FL_NOTIFY_DONE
authorWilly Tarreau <w@1wt.eu>
Fri, 27 Dec 2019 13:57:45 +0000 (14:57 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 27 Dec 2019 15:38:47 +0000 (16:38 +0100)
Both flags became equal in commit 82967bf9 ("MINOR: connection: adjust
CO_FL_NOTIFY_DATA after removal of flags"), which already predicted the
overlap between xprt_done_cb() and wake() after the removal of the DATA
specific flags in 1.8. Let's simply remove CO_FL_NOTIFY_DATA since the
"_DONE" version already covers everything and explains the intent well
enough.

include/types/connection.h
src/connection.c

index 165a683ae60c3d01c81fa795878931d26568652b..d51c9c401aa2efff74deaa699374a6e250cf19bd 100644 (file)
@@ -174,7 +174,6 @@ enum {
        /* flags used to report connection errors or other closing conditions */
        CO_FL_ERROR         = 0x00100000,  /* a fatal error was reported     */
        CO_FL_NOTIFY_DONE   = 0x001C0000,  /* any xprt shut/error flags above needs to be reported */
-       CO_FL_NOTIFY_DATA   = 0x001C0000,  /* any shut/error flags above needs to be reported */
 
        /* flags used to report connection status updates */
        CO_FL_CONNECTED     = 0x00200000,  /* L4+L6 now ready ; extra handshakes may or may not exist */
index 82890f9b18c462090c3110232f0715d760c8d138..3337538c8d729ae824de66ca48778c2e369a54f6 100644 (file)
@@ -126,8 +126,8 @@ void conn_fd_handler(int fd)
         * data layer activity (successful send/recv), connection establishment,
         * shutdown and fatal errors. We need to consider the following
         * situations to wake up the data layer :
-        *  - change among the CO_FL_NOTIFY_DATA flags :
-        *      {DATA,SOCK}_{RD,WR}_SH, ERROR,
+        *  - change among the CO_FL_NOTIFY_DONE flags :
+        *      SOCK_{RD,WR}_SH, ERROR,
         *  - absence of any of {L4,L6}_CONN and CONNECTED, indicating the
         *    end of handshake and transition to CONNECTED
         *  - raise of CONNECTED with HANDSHAKE down
@@ -137,7 +137,7 @@ void conn_fd_handler(int fd)
         * Note that the wake callback is allowed to release the connection and
         * the fd (and return < 0 in this case).
         */
-       if ((io_available || (((conn->flags ^ flags) & CO_FL_NOTIFY_DATA) ||
+       if ((io_available || (((conn->flags ^ flags) & CO_FL_NOTIFY_DONE) ||
             ((flags & (CO_FL_CONNECTED|CO_FL_HANDSHAKE)) != CO_FL_CONNECTED &&
              (conn->flags & (CO_FL_CONNECTED|CO_FL_HANDSHAKE)) == CO_FL_CONNECTED))) &&
            conn->mux && conn->mux->wake && conn->mux->wake(conn) < 0)