]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: cli: report an error message on missing argument to compression rate
authorWilly Tarreau <w@1wt.eu>
Tue, 20 Nov 2012 23:29:50 +0000 (00:29 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 21 Nov 2012 01:15:16 +0000 (02:15 +0100)
"set rate-limit http-compression global" needs an integer and must
complain when it's not there.

src/dumpstats.c

index 2a07140ee073716cfde2bfb0e5fc3ea3c4462388..db82005eef5766675b23d9c11fe0b32223a3ff90 100644 (file)
@@ -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. */
                                }