From: Amaury Denoyelle Date: Fri, 5 Mar 2021 14:34:56 +0000 (+0100) Subject: BUG/MINOR: backend: fix condition for reuse on mode HTTP X-Git-Tag: v2.4-dev11~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=249f0562cf2654488100d83d66c73902a2b1eb6c;p=thirdparty%2Fhaproxy.git BUG/MINOR: backend: fix condition for reuse on mode HTTP 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. --- diff --git a/src/backend.c b/src/backend.c index 15bab2291a..67a7625574 100644 --- a/src/backend.c +++ b/src/backend.c @@ -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