mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-10 09:07:02 +02:00
MEDIUM: stick-table: lookup table names using trees.
This will speed up config parsing time when many stick-table references are used, as well as stick-table manipulations from the CLI.
This commit is contained in:
parent
7ecc420bbc
commit
991610d33f
@ -716,9 +716,15 @@ int stktable_get_data_type(char *name)
|
|||||||
struct proxy *find_stktable(const char *name)
|
struct proxy *find_stktable(const char *name)
|
||||||
{
|
{
|
||||||
struct proxy *px;
|
struct proxy *px;
|
||||||
|
struct ebpt_node *node;
|
||||||
|
|
||||||
for (px = proxy; px; px = px->next) {
|
for (node = ebis_lookup(&proxy_by_name, name); node; node = ebpt_next(node)) {
|
||||||
if (px->table.size && strcmp(px->id, name) == 0)
|
px = container_of(node, struct proxy, conf.by_name);
|
||||||
|
|
||||||
|
if (strcmp(px->id, name) != 0)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (px->table.size)
|
||||||
return px;
|
return px;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user