]> git.kaiwu.me - haproxy.git/commit
MINOR: lb: make LB initialization even more declarative
authorMaxime Henrion <mhenrion@haproxy.com>
Wed, 29 Apr 2026 17:56:34 +0000 (13:56 -0400)
committerWilly Tarreau <w@1wt.eu>
Mon, 11 May 2026 06:50:40 +0000 (08:50 +0200)
commit87a4f6d47ea718087d8057c234299e4d06bffe51
tree2d60fbe3c83cd6e785f82aa9f3634f6e968ddab9
parent731fc033dd56196761e42efe0d39b3d4b4ef8203
MINOR: lb: make LB initialization even more declarative

This lets lb_ops specify the conditions necessary to bind to this set of
ops. The condition is expressed as a list of mask and match fields on
the algorithm flags. This is then used in proxy_finalize() to locate the
lb_ops corresponding to the current configuration, by iterating  over
the list of lb_ops structures. This list is implemented using the same
mechanisms used for configuration keywords: an INITCALL1 macro to a
registration function.

This also moves the lookup and property flags into the lb_ops structure
that were previously applied manually on a case by case basis.
16 files changed:
include/haproxy/backend-t.h
include/haproxy/backend.h
include/haproxy/lb_chash.h
include/haproxy/lb_fas.h
include/haproxy/lb_fwlc.h
include/haproxy/lb_fwrr.h
include/haproxy/lb_map.h
include/haproxy/lb_ss.h
src/backend.c
src/lb_chash.c
src/lb_fas.c
src/lb_fwlc.c
src/lb_fwrr.c
src/lb_map.c
src/lb_ss.c
src/proxy.c