From 68c00c71853de901eebca44d64623db4748dd532 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 25 Sep 2015 19:21:19 +0200 Subject: [PATCH] BUG/MINOR: stats: do not call cli_release_handler 3 times If an error happens during a dump on the CLI, an explicit call to cli_release_handler() is performed. This is not needed anymore since we introduced ->release() in the applet which is called upon error. Let's remove this confusing call which can even be risky in some situations. --- src/dumpstats.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/dumpstats.c b/src/dumpstats.c index 39bdd1714..c86ba4d1c 100644 --- a/src/dumpstats.c +++ b/src/dumpstats.c @@ -2482,13 +2482,7 @@ static void cli_io_handler(struct appctx *appctx) bo_skip(si_oc(si), reql); req->flags |= CF_READ_DONTWAIT; /* we plan to read small requests */ } - else { /* output functions: first check if the output buffer is closed then abort */ - if (res->flags & (CF_SHUTR_NOW|CF_SHUTR)) { - cli_release_handler(appctx); - appctx->st0 = STAT_CLI_END; - continue; - } - + else { /* output functions */ switch (appctx->st0) { case STAT_CLI_PRINT: if (bi_putstr(si_ic(si), appctx->ctx.cli.msg) != -1)