CLEANUP: cli: rename MAX_STATS_ARGS to MAX_CLI_ARGS
This is the number of args accepted on a command received on the CLI,
is has long been totally independent of stats and should not carry
this misleading "stats" name anymore.
diff --git a/include/haproxy/defaults.h b/include/haproxy/defaults.h
index 3dc98e5..f6a15db 100644
--- a/include/haproxy/defaults.h
+++ b/include/haproxy/defaults.h
@@ -110,9 +110,9 @@
// max # args on crt-bind-list configuration line
#define MAX_CRT_ARGS 2048
-// max # args on a stats socket
+// max # args on a command issued on the CLI ("stats socket")
// This should cover at least 5 + twice the # of data_types
-#define MAX_STATS_ARGS 64
+#define MAX_CLI_ARGS 64
// max # of matches per regexp
#define MAX_MATCH 10
diff --git a/src/cli.c b/src/cli.c
index 6791ff2..6859ad6 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -628,7 +628,7 @@
*/
static int cli_parse_request(struct appctx *appctx)
{
- char *args[MAX_STATS_ARGS + 1], *p, *end, *payload = NULL;
+ char *args[MAX_CLI_ARGS + 1], *p, *end, *payload = NULL;
int i = 0;
struct cli_kw *kw;
@@ -658,7 +658,7 @@
* Get pointers on words.
* One extra slot is reserved to store a pointer on a null byte.
*/
- while (i < MAX_STATS_ARGS && p < end) {
+ while (i < MAX_CLI_ARGS && p < end) {
int j, k;
/* skip leading spaces/tabs */
@@ -698,7 +698,7 @@
}
/* fill unused slots */
p = appctx->chunk->area + appctx->chunk->data;
- for (; i < MAX_STATS_ARGS + 1; i++)
+ for (; i < MAX_CLI_ARGS + 1; i++)
args[i] = p;
kw = cli_find_kw(args);
@@ -2182,7 +2182,7 @@
{
char *str = (char *)ci_head(req);
char *end = (char *)ci_stop(req);
- char *args[MAX_STATS_ARGS + 1]; /* +1 for storing a NULL */
+ char *args[MAX_CLI_ARGS + 1]; /* +1 for storing a NULL */
int argl; /* number of args */
char *p;
char *trim = NULL;
@@ -2239,7 +2239,7 @@
*(end-1) = '\0';
/* splits the command in words */
- while (i < MAX_STATS_ARGS && p < end) {
+ while (i < MAX_CLI_ARGS && p < end) {
/* skip leading spaces/tabs */
p += strspn(p, " \t");
if (!*p)
@@ -2264,7 +2264,7 @@
argl = i;
- for (; i < MAX_STATS_ARGS + 1; i++)
+ for (; i < MAX_CLI_ARGS + 1; i++)
args[i] = NULL;
wtrim = pcli_find_and_exec_kw(s, args, argl, errmsg, next_pid);