From: Christopher Faulet Date: Fri, 27 Sep 2024 16:14:33 +0000 (+0200) Subject: BUG/MINOR: mcli: Pretend the mux have more data to deliver between two commands X-Git-Tag: v3.1-dev9~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=688abb6f30a7eed76e63a92fc78bfccad681bd0d;p=thirdparty%2Fhaproxy.git BUG/MINOR: mcli: Pretend the mux have more data to deliver between two commands Since the commit "OPTIM: stconn: Don't pretend mux have more data to deliver on EOI/EOS/ERROR", the SC no longer pretend its mux have more data to deliver when one of EOI/EOS/ERROR flags are set on its sedesc. However, for the master cli, it is an issue because any EOI/EOS at the end of a command is in fact detected on the attempt to get the next command. To do so, the stream is reset. Because if the commit above, the next received is never performed. To fix the issue, when the stream is reset, the front SC pretend its mux have more data to deliver. This patch must only be bacported if the commit above is backported. --- diff --git a/src/cli.c b/src/cli.c index 1d80b76023..c890eb3f8e 100644 --- a/src/cli.c +++ b/src/cli.c @@ -3230,10 +3230,12 @@ int pcli_wait_for_response(struct stream *s, struct channel *rep, int an_bit) s->store_count = 0; s->uniq_id = _HA_ATOMIC_FETCH_ADD(&global.req_count, 1); - s->scf->flags &= ~(SC_FL_EOS|SC_FL_ERROR|SC_FL_ABRT_DONE|SC_FL_ABRT_WANTED); + s->scf->flags &= ~(SC_FL_EOI|SC_FL_EOS|SC_FL_ERROR|SC_FL_ABRT_DONE|SC_FL_ABRT_WANTED); s->scf->flags &= ~SC_FL_SND_NEVERWAIT; s->scf->flags |= SC_FL_RCV_ONCE; /* one read is usually enough */ + se_have_more_data(s->scf->sedesc); + s->req.flags |= CF_WAKE_ONCE; /* need to be called again if there is some command left in the request */ s->res.analysers &= ~AN_RES_WAIT_CLI;