]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: stconn: Report error on SC on send if a previous SE error was set
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 29 Jul 2024 15:48:16 +0000 (17:48 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 30 Jul 2024 07:05:25 +0000 (09:05 +0200)
When a send on a connection is performed, if a SE error (or a pending error)
was already reported earlier, we leave immediately. No send is performed.
However, we must be sure to report the error at the SC level if necessary.
Indeed, the SE error may have been reported during the zero-copy data
forwarding. So during receive on the opposite side. In that case, we may
have missed the opportunity to report it at the SC level.

The patch must be backported as far as 2.8.

src/stconn.c

index 093ffcb55213f7b1a8d05f54172639b1cfa560c4..8f9f264b9d90eefcde8e36abe65b9e243c95a5ae 100644 (file)
@@ -1589,6 +1589,8 @@ int sc_conn_send(struct stconn *sc)
                if (sc->state < SC_ST_CON)
                        return 0;
                BUG_ON(sc_ep_test(sc, SE_FL_EOS|SE_FL_ERROR|SE_FL_ERR_PENDING) == (SE_FL_EOS|SE_FL_ERR_PENDING));
+               if (sc_ep_test(sc, SE_FL_ERROR))
+                       sc->flags |= SC_FL_ERROR;
                return 1;
        }