From 54e58103e5fb5164b4c9e8c0fa82786b7a72b7dc Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Thu, 11 Dec 2025 17:11:36 +0100 Subject: [PATCH] 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. --- src/stconn.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/stconn.c b/src/stconn.c index f3b030fd6..1f2294fa2 100644 --- a/src/stconn.c +++ b/src/stconn.c @@ -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; } -- 2.47.3