BUG/MEDIUM: stconn: Don't report abort from SC if read0 was already received

SC_FL_ABRT_DONE flag should never be set when SC_FL_EOS was already
set. These both flags were introduced to replace the old CF_SHUTR and to
have a flag for shuts driven by the stream and a flag for the read0 received
by the mux. So both flags must not be seen at same time on a SC. It is
espeically important because some processing are performed when these flags
are set. And wrong decisions may be made.

This patch must be backproted as far as 2.8.
This commit is contained in:
Christopher Faulet 2025-12-11 17:11:36 +01:00
parent a483450fa2
commit 54e58103e5

View File

@ -694,7 +694,8 @@ static void sc_app_shut(struct stconn *sc)
}
sc->flags &= ~SC_FL_NOLINGER;
sc->flags |= SC_FL_ABRT_DONE;
if (!(sc->flags & (SC_FL_EOS|SC_FL_ABRT_DONE)))
sc->flags |= SC_FL_ABRT_DONE;
if (sc->flags & SC_FL_ISBACK)
__sc_strm(sc)->conn_exp = TICK_ETERNITY;
@ -830,7 +831,8 @@ static void sc_app_shut_conn(struct stconn *sc)
}
sc->flags &= ~SC_FL_NOLINGER;
sc->flags |= SC_FL_ABRT_DONE;
if (!(sc->flags & (SC_FL_EOS|SC_FL_ABRT_DONE)))
sc->flags |= SC_FL_ABRT_DONE;
if (sc->flags & SC_FL_ISBACK)
__sc_strm(sc)->conn_exp = TICK_ETERNITY;
}
@ -1014,7 +1016,8 @@ static void sc_app_shut_applet(struct stconn *sc)
}
sc->flags &= ~SC_FL_NOLINGER;
sc->flags |= SC_FL_ABRT_DONE;
if (!(sc->flags & (SC_FL_EOS|SC_FL_ABRT_DONE)))
sc->flags |= SC_FL_ABRT_DONE;
if (sc->flags & SC_FL_ISBACK)
__sc_strm(sc)->conn_exp = TICK_ETERNITY;
}