CLEANUP: log: remove deadcode in px_parse_log_steps()

When logsteps proxy storage was migrated from eb nodes to bitmasks in
6a92b14 ("MEDIUM: log/proxy: store log-steps selection using a bitmask,
not an eb tree"), some unused eb node related code was left over in
px_parse_log_steps()

Not only this code is unused, it also resulted in wasted memory since
an eb node was allocated for nothing.

This should fix GH #3121
This commit is contained in:
Aurelien DARRAGON 2025-09-16 08:17:03 +02:00
parent 3d73e6c818
commit 31b3be7aae

View File

@ -6848,7 +6848,6 @@ static int px_parse_log_steps(char **args, int section_type, struct proxy *curpx
str = args[1]; str = args[1];
while (str[0]) { while (str[0]) {
struct eb32_node *cur_step;
enum log_orig_id cur_id = LOG_ORIG_UNSPEC; enum log_orig_id cur_id = LOG_ORIG_UNSPEC;
cur_sep = strcspn(str, ","); cur_sep = strcspn(str, ",");
@ -6886,13 +6885,6 @@ static int px_parse_log_steps(char **args, int section_type, struct proxy *curpx
} }
} }
cur_step = malloc(sizeof(*cur_step));
if (!cur_step) {
memprintf(err, "memory failure when trying to configure log-step (%.*s)",
(int)cur_sep, str);
goto end;
}
cur_step->key = cur_id;
BUG_ON(cur_id > 64); // for now we don't support more than 64 log origins BUG_ON(cur_id > 64); // for now we don't support more than 64 log origins
curpx->conf.log_steps.steps_1 |= (1ULL << cur_id); curpx->conf.log_steps.steps_1 |= (1ULL << cur_id);
next: next: