BUG/MAJOR: cli: fix custom io_release was crushed by NULL.

The io_release could be set into the parsing request handler
and must not be crushed.

This patch should be backported on mainline branches 1.7 and 1.6
This commit is contained in:
Emeric Brun 2017-06-29 19:54:13 +02:00 committed by Willy Tarreau
parent 27f2dbbdfd
commit d6871f785f

View File

@ -464,9 +464,10 @@ static int cli_parse_request(struct appctx *appctx, char *line)
return 0;
appctx->io_handler = kw->io_handler;
appctx->io_release = kw->io_release;
/* kw->parse could set its own io_handler or ip_release handler */
if ((!kw->parse || kw->parse(args, appctx, kw->private) == 0) && appctx->io_handler) {
appctx->st0 = CLI_ST_CALLBACK;
appctx->io_release = kw->io_release;
}
return 1;
}