]> git.ipfire.org Git - thirdparty/haproxy.git/commit
CLEANUP: tree-wide: define and use acl_match_cond() helper
authorAurelien DARRAGON <adarragon@haproxy.com>
Wed, 22 Jan 2025 13:15:47 +0000 (14:15 +0100)
committerAurelien DARRAGON <adarragon@haproxy.com>
Mon, 27 Jan 2025 10:11:43 +0000 (11:11 +0100)
commite768a531b753ce4b49f8a05eed26b4a5d2a30e63
tree0c1bbce734afd8d9bbbfc1601470473cc7988e69
parent94d3b7375a3b84ddb8414d055254ba5193a38b48
CLEANUP: tree-wide: define and use acl_match_cond() helper

acl_match_cond() combines acl_exec_cond() + acl_pass() and a check on the
condition->pol (to check if the cond is inverted) in order to return
either 0 if the cond doesn't match or 1 if it matches (or NULL).

Thanks to this we can actually simplify some redundant constructs that
iterate over rules and evaluate if the condition matches or not.

Conditions for tcp-request inspect-content and tcp-response
inspect-content couldn't be simplified because they perform an extra
check for missing data, and thus still need to leverage acl_exec_cond()

It's best to display the patch using "-w", like "git show xxxx -w",
because some blocks had to be re-indented after the cleanup, which
makes the patch hard to review by default.
include/haproxy/acl.h
src/fcgi-app.c
src/flt_spoe.c
src/http_ana.c
src/quic_rules.c
src/stream.c
src/tcp_rules.c