BUG/MINOR: backend: check available list allocation for reuse
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 28 Jan 2021 16:33:26 +0000 (17:33 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 28 Jan 2021 17:13:36 +0000 (18:13 +0100)
commit14bb91b57232d9799e8adad6404785b9f5cb659e
tree8e80a99b3a0ee848ef42b3ad802fee62cc23c0a1
parent61185a5e10646c1d58ea8143aefaf553cc739593
BUG/MINOR: backend: check available list allocation for reuse

Do not consider reuse connection if available list is not allocated for
the target server. This will prevent a crash when using a standalone
server for an external purpose like socket_tcp/socket_ssl on hlua code.
For the idle/safe lists, they are considered allocated if
srv.max_idle_conns is not null.

Note that the hlua code is currently safe thanks to the additional
checks on proxy http mode and stream reuse policy not never. However,
this might not be sufficient for future code.

This patch should be backported in every branches containing the
following patch :
  7f68d815af356fbe1b2e1080a88b9935581c91d2 (2.4 tree)
  REORG: backend: simplify conn_backend_get

(cherry picked from commit a81bb7197eb538628274bffe3b09e87e564aeb89)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/backend.c