REORG: backend: simplify conn_backend_get
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 26 Jan 2021 13:35:26 +0000 (14:35 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 28 Jan 2021 15:59:19 +0000 (16:59 +0100)
commitc81fb7d203f2c5e959cdcced53851c26b10da382
tree3c3f2070158e1cc44c5e93096ca61e75f84d163a
parent3ee3a26f709dc615191457e1e14198bc12bad934
REORG: backend: simplify conn_backend_get

Reorganize the conditions for the reuse of idle/safe connections :
- reduce code by using variable to store reuse mode and idle/safe conns
  counts
- consider that idle/safe/avail lists are properly allocated if
  max_idle_conns not null. An allocation failure prevents haproxy
  startup.

(cherry picked from commit 7f68d815af356fbe1b2e1080a88b9935581c91d2)
[wt: harmless, backported since needed for the next one after careful
     review]
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/backend.c