]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: backend: fix condition for reuse on mode HTTP
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 5 Mar 2021 14:34:56 +0000 (15:34 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 5 Mar 2021 14:44:51 +0000 (15:44 +0100)
This commit is a fix/complement to the following one :
08d87b3f49867440f66aee09173c84bf58cbc859
BUG/MEDIUM: backend: never reuse a connection for tcp mode

It fixes the check for the early insertion of backend connections in
the reuse lists if the backend mode is HTTP.

The impact of this bug seems limited because :
- in tcp mode, no insertion is done in the avail list as mux_pt does not
  support multiple streams.
- in http mode, muxes are also responsible to insert backend connections
  in lists in their detach functions. Prior to this fix the reuse rate
  could be slightly inferior.

It can be backported to 2.3.

src/backend.c

index 15bab2291a44c74eb114e5b48a8349a3375a92f9..67a7625574a48d7aef5a46e4eb3d4e757f78c81c 100644 (file)
@@ -1644,7 +1644,7 @@ skip_reuse:
                        conn_full_close(srv_conn);
                        return SF_ERR_INTERNAL;
                }
-               if (s->be->mode != PR_MODE_HTTP) {
+               if (s->be->mode == PR_MODE_HTTP) {
                        /* 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