Skip to content

Commit aadda34

Browse files
zaga00wlallemand
authored andcommitted
BUILD: ot: use a cebtree instead of a list for variable names
In order for the function flt_ot_vars_scope_dump() to work, it is necessary to take into account the changes made by the commits 47ec7c6 ("OPTIM: vars: use a cebtree instead of a list for variable names") and 5d350d1 ("OPTIM: vars: use multiple name heads in the vars struct"). The function is only used if the OT_DEBUG=1 option is set when compiling HAProxy.
1 parent 581c8a2 commit aadda34

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

addons/ot/src/vars.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,21 @@
3939
*/
4040
static void flt_ot_vars_scope_dump(struct vars *vars, const char *scope)
4141
{
42-
const struct var *var;
42+
int i;
4343

4444
if (vars == NULL)
4545
return;
4646

4747
vars_rdlock(vars);
48-
list_for_each_entry(var, &(vars->head), l)
49-
FLT_OT_DBG(2, "'%s.%016" PRIx64 "' -> '%.*s'", scope, var->name_hash, (int)b_data(&(var->data.u.str)), b_orig(&(var->data.u.str)));
48+
for (i = 0; i < VAR_NAME_ROOTS; i++) {
49+
struct ceb_node *node = cebu64_first(&(vars->name_root[i]));
50+
51+
for ( ; node != NULL; node = cebu64_next(&(vars->name_root[i]), node)) {
52+
struct var *var = container_of(node, struct var, node);
53+
54+
FLT_OT_DBG(2, "'%s.%016" PRIx64 "' -> '%.*s'", scope, var->name_hash, (int)b_data(&(var->data.u.str)), b_orig(&(var->data.u.str)));
55+
}
56+
}
5057
vars_rdunlock(vars);
5158
}
5259

0 commit comments

Comments
 (0)