]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: rules: add a new function new_act_rule() to allocate act_rules
authorWilly Tarreau <w@1wt.eu>
Mon, 11 Oct 2021 06:49:26 +0000 (08:49 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 12 Oct 2021 05:38:30 +0000 (07:38 +0200)
commitd535f807bb424dfd6bdde6abf8d653b484e34afa
tree0ea752a91fc3e3be43fa14036f2461f13533e1b8
parente972c0acde990de30a00f76f7f61470d3325c757
MINOR: rules: add a new function new_act_rule() to allocate act_rules

Rules are currently allocated using calloc() by their caller, which does
not make it very convenient to pass more information such as the file
name and line number.

This patch introduces new_act_rule() which performs the malloc() and
already takes in argument the ruleset (ACT_F_*), the file name and the
line number. This saves the caller from having to assing ->from, and
will allow to improve the internal storage with more info.
include/haproxy/action.h
src/action.c
src/http_rules.c
src/tcp_rules.c
src/tcpcheck.c