]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: cli: be sure to always warn the cli applet when input buffer is full
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 5 Dec 2016 13:25:08 +0000 (14:25 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 12 Dec 2016 16:58:11 +0000 (17:58 +0100)
[wt: may only strike if CLI commands are pipelined. Must be backported to 1.7
 and 1.6, where it's a bit different and in dumpstats.c]

src/server.c

index 2f539c9993f2873bba50e2cb64634504f35f11c8..479631c8ebec8de3db4335584a9b5fcf1245895c 100644 (file)
@@ -3536,9 +3536,10 @@ static int cli_parse_get_weight(char **args, struct appctx *appctx, void *privat
 
        /* return server's effective weight at the moment */
        snprintf(trash.str, trash.size, "%d (initial %d)\n", sv->uweight, sv->iweight);
-       if (bi_putstr(si_ic(si), trash.str) == -1)
+       if (bi_putstr(si_ic(si), trash.str) == -1) {
                si_applet_cant_put(si);
-
+               return 0;
+       }
        return 1;
 }