From 015fec6a29123fdbfe7b7185db6c0c659ef69399 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Tue, 5 Sep 2023 12:02:25 +0200 Subject: [PATCH] BUG/MINOR: stconn: Don't inhibit shutdown on connection on error In the SC function responsible to perform shutdown, there is a statement inhibiting the shutdown if an error was encountered on the SC. This statement is inherited from very old version and should in fact be removed. The error may be set from the stream. In this case the shutdown must be performed. In all cases, it is not a big deal if the shutdown is performed twice because underlying functions already handle multiple calls. This patch does not fix any bug. Thus there is no reason to backport it. --- src/stconn.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/stconn.c b/src/stconn.c index 643d78e37..68313cd8d 100644 --- a/src/stconn.c +++ b/src/stconn.c @@ -715,11 +715,7 @@ static void sc_app_shut_conn(struct stconn *sc) * However, if SC_FL_NOLINGER is explicitly set, we know there is * no risk so we close both sides immediately. */ - - if (sc->flags & SC_FL_ERROR) { - /* quick close, the socket is already shut anyway */ - } - else if (sc->flags & SC_FL_NOLINGER) { + if (sc->flags & SC_FL_NOLINGER) { /* unclean data-layer shutdown, typically an aborted request * or a forwarded shutdown from a client to a server due to * option abortonclose. No need for the TLS layer to try to -- 2.47.3