MINOR: cli: report an error message on missing argument to compression rate

"set rate-limit http-compression global" needs an integer and must
complain when it's not there.
This commit is contained in:
Willy Tarreau 2012-11-21 00:29:50 +01:00
parent 072a2bf537
commit 85d47f9d98

View File

@ -1274,6 +1274,12 @@ static int stats_sock_parse_request(struct stream_interface *si, char *line)
if (strcmp(args[3], "global") == 0) { if (strcmp(args[3], "global") == 0) {
int v; int v;
if (!*args[4]) {
si->applet.ctx.cli.msg = "Expects a maximum input byte rate in kB/s.\n";
si->applet.st0 = STAT_CLI_PRINT;
return 1;
}
v = atoi(args[4]); v = atoi(args[4]);
global.comp_rate_lim = v * 1024; /* Kilo to bytes. */ global.comp_rate_lim = v * 1024; /* Kilo to bytes. */
} }