]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: mcli: Pretend the mux have more data to deliver between two commands
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 27 Sep 2024 16:14:33 +0000 (18:14 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 30 Sep 2024 14:55:53 +0000 (16:55 +0200)
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.

src/cli.c

index 1d80b760238bd32526dd418b5049bbad5898afa8..c890eb3f8e50d8aae6dd8bf8c4f92dbb631bfe3e 100644 (file)
--- 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;