mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 07:37:02 +02:00
BUG/MEDIUM: cli: Set SE_FL_EOI flag for '_getsocks' and 'quit' commands
An applet must never set SE_FL_EOS flag without SE_FL_EOI or SE_FL_ERROR flags. Here, SE_FL_EOI flag was missing for "quit" or "_getsocks" commands. Indeed, these commands are terminal. This bug triggers a BUG_ON() recently added. This patch is related to the issue #2107. It is 2.8-specific. No backport needed.
This commit is contained in:
parent
768b62857e
commit
33af99655e
@ -2172,6 +2172,7 @@ static int _getsocks(char **args, char *payload, struct appctx *appctx, void *pr
|
|||||||
ha_warning("Cannot make the unix socket non-blocking\n");
|
ha_warning("Cannot make the unix socket non-blocking\n");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
se_fl_set(appctx->sedesc, SE_FL_EOI);
|
||||||
appctx->st0 = CLI_ST_END;
|
appctx->st0 = CLI_ST_END;
|
||||||
free(cmsgbuf);
|
free(cmsgbuf);
|
||||||
free(tmpbuf);
|
free(tmpbuf);
|
||||||
@ -2186,9 +2187,11 @@ static int cli_parse_simple(char **args, char *payload, struct appctx *appctx, v
|
|||||||
else if (*args[0] == 'p')
|
else if (*args[0] == 'p')
|
||||||
/* prompt */
|
/* prompt */
|
||||||
appctx->st1 ^= APPCTX_CLI_ST1_PROMPT;
|
appctx->st1 ^= APPCTX_CLI_ST1_PROMPT;
|
||||||
else if (*args[0] == 'q')
|
else if (*args[0] == 'q') {
|
||||||
/* quit */
|
/* quit */
|
||||||
|
se_fl_set(appctx->sedesc, SE_FL_EOI);
|
||||||
appctx->st0 = CLI_ST_END;
|
appctx->st0 = CLI_ST_END;
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user