CLEANUP: proxy: make the proxy lookup functions more user-friendly
First, findproxy() was renamed proxy_find_by_name() so that its explicit
that a name is required for the lookup. Second, we give this function
the ability to search for tables if needed. Third we now provide inline
wrappers to pass the appropriate PR_CAP_* flags and to explicitly look
up a frontend, backend or table.
diff --git a/src/dumpstats.c b/src/dumpstats.c
index 885a159..559f229 100644
--- a/src/dumpstats.c
+++ b/src/dumpstats.c
@@ -924,7 +924,7 @@
return NULL;
}
- px = findproxy(arg, PR_CAP_FE);
+ px = proxy_fe_by_name(arg);
if (!px) {
appctx->ctx.cli.msg = "No such frontend.\n";
appctx->st0 = STAT_CLI_PRINT;
@@ -4622,7 +4622,7 @@
/* Now we can check the key to see what to do */
if (!px && (strcmp(key, "b") == 0)) {
- if ((px = findproxy(value, PR_CAP_BE)) == NULL) {
+ if ((px = proxy_be_by_name(value)) == NULL) {
/* the backend name is unknown or ambiguous (duplicate names) */
appctx->ctx.stats.st_code = STAT_STATUS_ERRP;
goto out;