diff options
| author | Willy Tarreau <w@1wt.eu> | 2021-10-11 08:49:26 +0200 |
|---|---|---|
| committer | Willy Tarreau <w@1wt.eu> | 2021-10-12 07:38:30 +0200 |
| commit | d535f807bb424dfd6bdde6abf8d653b484e34afa (patch) | |
| tree | 0ea752a91fc3e3be43fa14036f2461f13533e1b8 /include/haproxy/action.h | |
| parent | e972c0acde990de30a00f76f7f61470d3325c757 (diff) | |
| download | haproxy-d535f807bb424dfd6bdde6abf8d653b484e34afa.tar.gz | |
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.
Diffstat (limited to 'include/haproxy/action.h')
| -rw-r--r-- | include/haproxy/action.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/haproxy/action.h b/include/haproxy/action.h index 9ea5847c9..5d751ac42 100644 --- a/include/haproxy/action.h +++ b/include/haproxy/action.h @@ -111,6 +111,7 @@ static inline void release_timeout_action(struct act_rule *rule) release_sample_expr(rule->arg.timeout.expr); } +struct act_rule *new_act_rule(enum act_from from, const char *file, int linenum); void free_act_rules(struct list *rules); #endif /* _HAPROXY_ACTION_H */ |
