]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: connection: Don't consider new private connections as available
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 30 Jun 2020 12:47:46 +0000 (14:47 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 7 Jul 2020 12:30:38 +0000 (14:30 +0200)
When a connection is created and the multiplexer is installed, if the connection
is marked as private, don't consider it as available, regardless the number of
available streams. This test is performed when the mux is installed when the
connection is created, in connect_server(), and when the mux is installed after
the handshakes stage.

No backport needed, this is 2.2-dev.

src/backend.c
src/connection.c

index 5958a824e9dbf55c811556a8991a7cfeaca7b1ad..324d7565a4f2836f7bc0012c561e04855b59102b 100644 (file)
@@ -1529,12 +1529,12 @@ int connect_server(struct stream *s)
                        conn_full_close(srv_conn);
                        return SF_ERR_INTERNAL;
                }
-               /* If we're doing http-reuse always, and the connection
-                * is an http2 connection, add it to the available list,
-                * so that others can use it right away.
+               /* If we're doing http-reuse always, and the connection is not
+                * private with available streams (an http2 connection), add it
+                * to the available list, so that others can use it right away.
                 */
                if (srv && ((s->be->options & PR_O_REUSE_MASK) == PR_O_REUSE_ALWS) &&
-                   srv_conn->mux->avail_streams(srv_conn) > 0)
+                   !(srv_conn->flags & CO_FL_PRIVATE) && srv_conn->mux->avail_streams(srv_conn) > 0)
                        LIST_ADDQ(&srv->available_conns[tid], mt_list_to_list(&srv_conn->list));
        }
        /* The CO_FL_SEND_PROXY flag may have been set by the connect method,
index da0d406cb9afb8b2dc69deeeacefb20123e6b354..56921bec572c376b2ba0a408d6a4b259f1c17958 100644 (file)
@@ -61,7 +61,7 @@ int conn_create_mux(struct connection *conn)
                        goto fail;
                srv = objt_server(conn->target);
                if (srv && ((srv->proxy->options & PR_O_REUSE_MASK) != PR_O_REUSE_NEVR) &&
-                   conn->mux->avail_streams(conn) > 0)
+                   !(conn->flags & CO_FL_PRIVATE) && conn->mux->avail_streams(conn) > 0)
                        LIST_ADDQ(&srv->available_conns[tid], mt_list_to_list(&conn->list));
                return 0;
 fail: