From: Christopher Faulet Date: Fri, 14 Apr 2023 05:49:45 +0000 (+0200) Subject: BUG/MINOR: cli: Don't close when SE_FL_ERR_PENDING is set in cli analyzer X-Git-Tag: v2.8-dev8~145 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d3bc340e7ef4e47b10d04c30c794fb690e83a4d2;p=thirdparty%2Fhaproxy.git BUG/MINOR: cli: Don't close when SE_FL_ERR_PENDING is set in cli analyzer SE_FL_ERR_PENDING is used to report an error on the write side. But it is not a terminal error. Some incoming data may still be available. In the cli analyzers, it is important to not close the stream when this flag is set. Otherwise the response to a command can be truncated. It is probably hard to observe. But it remains a bug. While this patch could be backported to 2.7, there is no real reason to do so, except if someone reports a bug about truncated responses. --- diff --git a/src/cli.c b/src/cli.c index 1dc160da8d..d8c3d44abe 100644 --- a/src/cli.c +++ b/src/cli.c @@ -2715,7 +2715,7 @@ int pcli_wait_for_response(struct stream *s, struct channel *rep, int an_bit) struct proxy *fe = strm_fe(s); struct proxy *be = s->be; - if (sc_ep_test(s->scb, SE_FL_ERR_PENDING|SE_FL_ERROR) || (rep->flags & (CF_READ_TIMEOUT|CF_WRITE_TIMEOUT)) || + if (sc_ep_test(s->scb, SE_FL_ERROR) || (rep->flags & (CF_READ_TIMEOUT|CF_WRITE_TIMEOUT)) || ((s->scf->flags & SC_FL_SHUT_DONE) && (rep->to_forward || co_data(rep)))) { pcli_reply_and_close(s, "Can't connect to the target CLI!\n"); s->req.analysers &= ~AN_REQ_WAIT_CLI;