BUG/MINOR: backend: do not set sni on connection reuse
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 1 Jun 2021 15:04:10 +0000 (17:04 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 24 Dec 2021 17:02:27 +0000 (18:02 +0100)
commitf54ae0294fe33a41b0a04c99faec2ec859f0d57d
tree33973f3d6cd293ad42b48af97edd75f6ae0a246e
parent5122a79f5954130b7dd3ba41a322dd898bb3c191
BUG/MINOR: backend: do not set sni on connection reuse

When reusing a backend connection, do not reapply the SNI on the
connection. It should already be defined when the connection was
instantiated on a previous connect_server invocation. As the SNI is a
parameter used to select a connection, only connection with same value
can be reused.

The impact of this bug is unknown and may be null. No memory leak has
been reported by valgrind. So this is more a cleaning fix.

This commit relies on the SF_SRV_REUSED flag and thus depends on the
following fix :
  BUG/MINOR: backend: restore the SF_SRV_REUSED flag original purpose

This should be backported up to 2.4.

(cherry picked from commit 655dec81bde67a3e1acb146b18e6a038fe8c797b)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit 4568a4bba6f7e6f19a9f1d184ecf6e572b6942f1)
[wt: adjusted to fit with the existing condition]
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/backend.c