mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 15:47:01 +02:00
MINOR: cli: No longer check SC for shutdown to interrupt wait command
Thanks to the previous patch ("MEDIUM: applet: Add notion of shutdown for write for applets"), it is no longer necessary to check SC flags to detect shutdowns to interrupt the wait command. It is possible to remove this ugly workaround. In addition, we only test the SE for shutdown because end of stream and error are already checked by the CLI I/O handler. And it is no longer necessary to remove output data from the channel's buffer because shutdown are not reported if there are remaining outgoing data. Of course, if the "wait" command is backported, the commit above and this one must be backported too.
This commit is contained in:
parent
4a78f766ff
commit
5895fa8ce0
@ -2093,7 +2093,6 @@ static int cli_parse_wait(char **args, char *payload, struct appctx *appctx, voi
|
|||||||
static int cli_io_handler_wait(struct appctx *appctx)
|
static int cli_io_handler_wait(struct appctx *appctx)
|
||||||
{
|
{
|
||||||
struct cli_wait_ctx *ctx = appctx->svcctx;
|
struct cli_wait_ctx *ctx = appctx->svcctx;
|
||||||
struct stconn *sc = appctx_sc(appctx);
|
|
||||||
uint total, elapsed, left, wait;
|
uint total, elapsed, left, wait;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -2147,12 +2146,11 @@ static int cli_io_handler_wait(struct appctx *appctx)
|
|||||||
|
|
||||||
wait:
|
wait:
|
||||||
/* Stop waiting upon close/abort/error */
|
/* Stop waiting upon close/abort/error */
|
||||||
if (unlikely((sc->flags & SC_FL_SHUT_DONE) ||
|
if (unlikely(se_fl_test(appctx->sedesc, SE_FL_SHW))) {
|
||||||
se_fl_test(appctx->sedesc, (SE_FL_EOS|SE_FL_ERROR|SE_FL_SHR|SE_FL_SHW)))) {
|
|
||||||
co_skip(sc_oc(sc), sc_oc(sc)->output);
|
|
||||||
ctx->error = CLI_WAIT_ERR_INTR;
|
ctx->error = CLI_WAIT_ERR_INTR;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user