]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: connections: Don't forget to remove CO_FL_SESS_IDLE.
authorOlivier Houchard <ohouchard@haproxy.com>
Thu, 31 Jan 2019 18:31:19 +0000 (19:31 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 31 Jan 2019 18:38:25 +0000 (19:38 +0100)
If we're adding a connection to the server orphan idle list, don't forget
to remove the CO_FL_SESS_IDLE flag, or we will assume later it's still
attached to a session.

This should be backported to 1.9.

include/proto/session.h
src/session.c

index 0b7d08d9950fa0b6f7c6cf1bdee667eca43c9f4b..f1e33fa0cd29c13b11b05a81c45f08d0173ae761 100644 (file)
@@ -128,7 +128,8 @@ static inline int session_check_idle_conn(struct session *sess, struct connectio
                        /* The server doesn't want it, let's kill the connection right away */
                        conn->mux->destroy(conn);
                        return -1;
-               }
+               } else
+                       conn->flags &= ~CO_FL_SESS_IDLE;
                return 1;
        } else {
                conn->flags |= CO_FL_SESS_IDLE;
index 9e95b328a6576aa2fba645b6c20979c4543a249a..2732dbca818202ce260ada7fae2a980e12548057 100644 (file)
@@ -87,6 +87,7 @@ void session_free(struct session *sess)
                                LIST_DEL(&conn->session_list);
                                LIST_INIT(&conn->session_list);
                                conn->owner = NULL;
+                               conn->flags &= ~CO_FL_SESS_IDLE;
                                if (!srv_add_to_idle_list(objt_server(conn->target), conn))
                                        conn->mux->destroy(conn);
                        } else {