mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-05 13:03:40 +02:00
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.
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user