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.
This commit is contained in:
Christopher Faulet 2024-09-27 18:14:33 +02:00
parent bca5e14235
commit 688abb6f30

View File

@ -3230,10 +3230,12 @@ int pcli_wait_for_response(struct stream *s, struct channel *rep, int an_bit)
s->store_count = 0; s->store_count = 0;
s->uniq_id = _HA_ATOMIC_FETCH_ADD(&global.req_count, 1); 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_SND_NEVERWAIT;
s->scf->flags |= SC_FL_RCV_ONCE; /* one read is usually enough */ 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->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; s->res.analysers &= ~AN_RES_WAIT_CLI;