]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: stconn: Don't inhibit shutdown on connection on error
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 5 Sep 2023 10:02:25 +0000 (12:02 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 6 Sep 2023 07:29:27 +0000 (09:29 +0200)
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

index 643d78e376219111b73d1b03f72b37eeb07a0a99..68313cd8d67f88b47a236788d2fb17b8cdd62306 100644 (file)
@@ -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