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
diff --git a/src/cli.c b/src/cli.c
index 55115d6..fef34e9 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -464,9 +464,10 @@
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;
}