mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-20 21:31:28 +02:00
MINOR: log/backend: prevent stick table and stick rules with LOG mode
Report a warning and prevent errors if user tries to declare a stick table or use stick rules within a log backend.
This commit is contained in:
parent
5335618967
commit
4b2616f784
@ -86,6 +86,7 @@ void proxy_adjust_all_maxconn(void);
|
||||
struct proxy *cli_find_frontend(struct appctx *appctx, const char *arg);
|
||||
struct proxy *cli_find_frontend(struct appctx *appctx, const char *arg);
|
||||
int resolve_stick_rule(struct proxy *curproxy, struct sticking_rule *mrule);
|
||||
void free_stick_rules(struct list *rules);
|
||||
|
||||
/*
|
||||
* This function returns a string containing the type of the proxy in a format
|
||||
|
17
src/log.c
17
src/log.c
@ -898,6 +898,23 @@ static int _postcheck_log_backend_compat(struct proxy *be)
|
||||
err_code |= ERR_WARN;
|
||||
free_act_rules(&be->tcp_rep.inspect_rules);
|
||||
}
|
||||
if (be->table) {
|
||||
ha_warning("Cannot use stick table with 'mode log' in %s '%s'. It will be ignored.\n",
|
||||
proxy_type_str(be), be->id);
|
||||
|
||||
err_code |= ERR_WARN;
|
||||
stktable_deinit(be->table);
|
||||
ha_free(&be->table);
|
||||
}
|
||||
if (!LIST_ISEMPTY(&be->storersp_rules) ||
|
||||
!LIST_ISEMPTY(&be->sticking_rules)) {
|
||||
ha_warning("Cannot use sticking rules with 'mode log' in %s '%s'. They will be ignored.\n",
|
||||
proxy_type_str(be), be->id);
|
||||
|
||||
err_code |= ERR_WARN;
|
||||
free_stick_rules(&be->storersp_rules);
|
||||
free_stick_rules(&be->sticking_rules);
|
||||
}
|
||||
return err_code;
|
||||
}
|
||||
|
||||
|
@ -165,7 +165,7 @@ int resolve_stick_rule(struct proxy *curproxy, struct sticking_rule *mrule)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void free_stick_rules(struct list *rules)
|
||||
void free_stick_rules(struct list *rules)
|
||||
{
|
||||
struct sticking_rule *rule, *ruleb;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user