MINOR: log/backend: prevent "use-server" rules use with LOG mode

server_rules declared using "use-server" keyword within a proxy are not
supported inside a log backend (with "mode log" set), so we report a
warning to the user and reset the setting.
This commit is contained in:
Aurelien DARRAGON 2023-11-23 16:40:19 +01:00 committed by Christopher Faulet
parent f2629ebd4e
commit 661c079bc5

View File

@ -929,6 +929,13 @@ static int _postcheck_log_backend_compat(struct proxy *be)
err_code |= ERR_WARN;
ha_free(&be->dyncookie_key);
}
if (!LIST_ISEMPTY(&be->server_rules)) {
ha_warning("Cannot use \"use-server\" rules with 'mode log' in %s '%s'. They will be ignored.\n",
proxy_type_str(be), be->id);
err_code |= ERR_WARN;
free_server_rules(&be->server_rules);
}
return err_code;
}