MEDIUM: stick-table: remove the now duplicate find_stktable() function
Since proxy_tbl_by_name() already does the same job, let's not keep
duplicate functions and use this one only.
diff --git a/include/proto/stick_table.h b/include/proto/stick_table.h
index de9fd52..8c97f73 100644
--- a/include/proto/stick_table.h
+++ b/include/proto/stick_table.h
@@ -53,7 +53,6 @@
int stktable_compatible_sample(struct sample_expr *expr, unsigned long table_type);
int stktable_register_data_store(int idx, const char *name, int std_type, int arg_type);
int stktable_get_data_type(char *name);
-struct proxy *find_stktable(const char *name);
int stktable_trash_oldest(struct stktable *t, int to_batch);
/* return allocation size for standard data type <type> */
diff --git a/src/cfgparse.c b/src/cfgparse.c
index 778edf7..1de7a1f 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -3461,7 +3461,7 @@
int myidx = 1;
struct proxy *other;
- other = find_stktable(curproxy->id);
+ other = proxy_tbl_by_name(curproxy->id);
if (other) {
Alert("parsing [%s:%d] : stick-table name '%s' conflicts with table declared in %s '%s' at %s:%d.\n",
file, linenum, curproxy->id, proxy_type_str(other), other->id, other->conf.file, other->conf.line);
diff --git a/src/dumpstats.c b/src/dumpstats.c
index 559f229..3f5c069 100644
--- a/src/dumpstats.c
+++ b/src/dumpstats.c
@@ -866,7 +866,7 @@
appctx->st0 = action;
if (*args[2]) {
- appctx->ctx.table.target = find_stktable(args[2]);
+ appctx->ctx.table.target = proxy_tbl_by_name(args[2]);
if (!appctx->ctx.table.target) {
appctx->ctx.cli.msg = "No such table\n";
appctx->st0 = STAT_CLI_PRINT;
diff --git a/src/hlua.c b/src/hlua.c
index 5e1bdc3..eec37fa 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -654,7 +654,7 @@
WILL_LJMP(luaL_argerror(L, first + idx, "string expected"));
memcpy(trash.str, argp[idx].data.str.str, argp[idx].data.str.len);
trash.str[argp[idx].data.str.len] = 0;
- argp[idx].data.prx = find_stktable(trash.str);
+ argp[idx].data.prx = proxy_tbl_by_name(trash.str);
if (!argp[idx].data.prx)
WILL_LJMP(luaL_argerror(L, first + idx, "table doesn't exist"));
argp[idx].type = ARGT_TAB;
diff --git a/src/sample.c b/src/sample.c
index 3ad2d20..47d48c8 100644
--- a/src/sample.c
+++ b/src/sample.c
@@ -1214,7 +1214,7 @@
case ARGT_TAB:
if (arg->data.str.len) {
pname = arg->data.str.str;
- px = find_stktable(pname);
+ px = proxy_tbl_by_name(pname);
}
if (!px) {
diff --git a/src/stick_table.c b/src/stick_table.c
index 19d6af1..b68772c 100644
--- a/src/stick_table.c
+++ b/src/stick_table.c
@@ -784,24 +784,6 @@
return -1;
}
-/* Returns pointer to proxy containing table <name> or NULL if not found */
-struct proxy *find_stktable(const char *name)
-{
- struct proxy *px;
- struct ebpt_node *node;
-
- for (node = ebis_lookup(&proxy_by_name, name); node; node = ebpt_next(node)) {
- px = container_of(node, struct proxy, conf.by_name);
-
- if (strcmp(px->id, name) != 0)
- break;
-
- if (px->table.size)
- return px;
- }
- return NULL;
-}
-
/* Casts sample <smp> to the type of the table specified in arg(0), and looks
* it up into this table. Returns true if found, false otherwise. The input
* type is STR so that input samples are converted to string (since all types