BUG/MINOR: stconn: Pretend the SE have more data to deliver on abortonclose

When abortonclose option is enabled on the backend, at the SC level, we must
still pretend the SE have more data to deliver to be able to receive the
EOS. It must be performed at 2 places:

  * When the backend is set and the connection is requested. It is when the
    option is seen for the first time.

  * After a receive attempt, if the EOI flag is set on the sedesc.

Otherwise, when an abort is detected by the mux, the SC is not
notified.

This patch should fix the issue #2764.

This bug probably exists in all stable version but is only visible since
bca5e1423 ("OPTIM: stconn: Don't pretend mux have more data to deliver on
EOI/EOS/ERROR"). So I suggest to not backport it for now, except if the commit
above is backported.
This commit is contained in:
Christopher Faulet 2024-10-22 08:26:20 +02:00
parent ded28f6e5c
commit 7dc930d231
2 changed files with 6 additions and 2 deletions

View File

@ -1546,8 +1546,11 @@ int sc_conn_recv(struct stconn *sc)
se_have_no_more_data(sc->sedesc);
}
else if (sc->flags & SC_FL_EOI) {
/* No more data are expected at this stage */
se_have_no_more_data(sc->sedesc);
/* No more data are expected at this stage, except if abortonclose is enabled */
if (!(flags & CO_RFL_KEEP_RECV))
se_have_no_more_data(sc->sedesc);
else
se_have_more_data(sc->sedesc);
}
else {
/* The mux may have more data to deliver. Be sure to be able to

View File

@ -2316,6 +2316,7 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
if (s->be->options & PR_O_ABRT_CLOSE) {
struct connection *conn = sc_conn(scf);
se_have_more_data(scf->sedesc);
if (conn && conn->mux && conn->mux->ctl)
conn->mux->ctl(conn, MUX_CTL_SUBS_RECV, NULL);
}