]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: connection: See new connection as available only on reuse always
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 1 Jul 2020 12:59:43 +0000 (14:59 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 7 Jul 2020 12:31:01 +0000 (14:31 +0200)
When the multiplexer creation is delayed after the handshakes phase, the
connection is added in the available connection list if http-reuse never is not
configured for the backend. But it is a wrong statement. At this step, the
connection is not safe because it is a new connection. So it must be added in
the available connection list only if http-reuse always is used.

No backport needed, this is 2.2-dev.

src/connection.c

index 56921bec572c376b2ba0a408d6a4b259f1c17958..11b1747679dc2059469ad758b8456837294d8fc5 100644 (file)
@@ -60,7 +60,7 @@ int conn_create_mux(struct connection *conn)
                else if (conn_install_mux_be(conn, conn->ctx, conn->owner) < 0)
                        goto fail;
                srv = objt_server(conn->target);
-               if (srv && ((srv->proxy->options & PR_O_REUSE_MASK) != PR_O_REUSE_NEVR) &&
+               if (srv && ((srv->proxy->options & PR_O_REUSE_MASK) == PR_O_REUSE_ALWS) &&
                    !(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;