From: Willy Tarreau Date: Tue, 20 Nov 2012 23:29:50 +0000 (+0100) Subject: MINOR: cli: report an error message on missing argument to compression rate X-Git-Tag: v1.5-dev13~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=85d47f9d9855bb52f3bf556b99170b710bed1a08;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/dumpstats.c b/src/dumpstats.c index 2a07140ee0..db82005eef 100644 --- a/src/dumpstats.c +++ b/src/dumpstats.c @@ -1274,6 +1274,12 @@ static int stats_sock_parse_request(struct stream_interface *si, char *line) if (strcmp(args[3], "global") == 0) { 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]); global.comp_rate_lim = v * 1024; /* Kilo to bytes. */ }