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>
Tue, 26 Jan 2021 13:48:39 +0000 (14:48 +0100)
commit7f68d815af356fbe1b2e1080a88b9935581c91d2
tree96836a53d36bad2415dfd8fa69de375bd82a416c
parent37e25bcd1e2cf9beb6d976f52b79a4721ecd679f
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.
src/backend.c