int (*io_handler)(struct appctx *appctx); /* used within the cli_io_handler when st0 = CLI_ST_CALLBACK */
void (*io_release)(struct appctx *appctx); /* used within the cli_io_handler when st0 = CLI_ST_CALLBACK,
if the command is terminated or the session released */
+ struct cli_kw *kw; /* the keyword being processed */
} cli_ctx; /* context dedicated to the CLI applet */
struct buffer_wait buffer_wait; /* position in the list of objects waiting for a buffer */
else if (kw->level == ACCESS_EXPERIMENTAL)
mark_tainted(TAINTED_CLI_EXPERIMENTAL_MODE);
+ appctx->cli_ctx.kw = kw;
appctx->cli_ctx.io_handler = kw->io_handler;
appctx->cli_ctx.io_release = kw->io_release;
goto end;
fail:
+ appctx->cli_ctx.kw = NULL;
appctx->cli_ctx.io_handler = NULL;
appctx->cli_ctx.io_release = NULL;
if (appctx->cli_ctx.io_release) {
appctx->cli_ctx.io_release(appctx);
appctx->cli_ctx.io_release = NULL;
+ appctx->cli_ctx.kw = NULL;
/* some release handlers might have
* pending output to print.
*/
continue;
}
+ appctx->cli_ctx.kw = NULL;
}
break;
default: /* abnormal state */
if (appctx->cli_ctx.io_release) {
appctx->cli_ctx.io_release(appctx);
appctx->cli_ctx.io_release = NULL;
+ appctx->cli_ctx.kw = NULL;
}
else if (appctx->st0 == CLI_ST_PRINT_DYN || appctx->st0 == CLI_ST_PRINT_DYNERR) {
struct cli_print_ctx *ctx = applet_reserve_svcctx(appctx, sizeof(*ctx));