1
0
mirror of http://git.haproxy.org/git/haproxy.git/ synced 2025-05-16 14:48:03 +00:00

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.
This commit is contained in:
Willy Tarreau 2021-03-13 10:59:23 +01:00
parent c57dcfe787
commit f14c7570d6
2 changed files with 8 additions and 8 deletions
include/haproxy
src

View File

@ -110,9 +110,9 @@
// max # args on crt-bind-list configuration line // max # args on crt-bind-list configuration line
#define MAX_CRT_ARGS 2048 #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 // 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 // max # of matches per regexp
#define MAX_MATCH 10 #define MAX_MATCH 10

View File

@ -628,7 +628,7 @@ static int cli_get_severity_output(struct appctx *appctx)
*/ */
static int cli_parse_request(struct appctx *appctx) 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; int i = 0;
struct cli_kw *kw; struct cli_kw *kw;
@ -658,7 +658,7 @@ static int cli_parse_request(struct appctx *appctx)
* Get pointers on words. * Get pointers on words.
* One extra slot is reserved to store a pointer on a null byte. * 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; int j, k;
/* skip leading spaces/tabs */ /* skip leading spaces/tabs */
@ -698,7 +698,7 @@ static int cli_parse_request(struct appctx *appctx)
} }
/* fill unused slots */ /* fill unused slots */
p = appctx->chunk->area + appctx->chunk->data; p = appctx->chunk->area + appctx->chunk->data;
for (; i < MAX_STATS_ARGS + 1; i++) for (; i < MAX_CLI_ARGS + 1; i++)
args[i] = p; args[i] = p;
kw = cli_find_kw(args); kw = cli_find_kw(args);
@ -2182,7 +2182,7 @@ int pcli_parse_request(struct stream *s, struct channel *req, char **errmsg, int
{ {
char *str = (char *)ci_head(req); char *str = (char *)ci_head(req);
char *end = (char *)ci_stop(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 */ int argl; /* number of args */
char *p; char *p;
char *trim = NULL; char *trim = NULL;
@ -2239,7 +2239,7 @@ int pcli_parse_request(struct stream *s, struct channel *req, char **errmsg, int
*(end-1) = '\0'; *(end-1) = '\0';
/* splits the command in words */ /* splits the command in words */
while (i < MAX_STATS_ARGS && p < end) { while (i < MAX_CLI_ARGS && p < end) {
/* skip leading spaces/tabs */ /* skip leading spaces/tabs */
p += strspn(p, " \t"); p += strspn(p, " \t");
if (!*p) if (!*p)
@ -2264,7 +2264,7 @@ int pcli_parse_request(struct stream *s, struct channel *req, char **errmsg, int
argl = i; argl = i;
for (; i < MAX_STATS_ARGS + 1; i++) for (; i < MAX_CLI_ARGS + 1; i++)
args[i] = NULL; args[i] = NULL;
wtrim = pcli_find_and_exec_kw(s, args, argl, errmsg, next_pid); wtrim = pcli_find_and_exec_kw(s, args, argl, errmsg, next_pid);