]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-spop: Set SPOP_CF_ERROR flag on connection error only
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 4 Feb 2025 09:58:35 +0000 (10:58 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 6 Feb 2025 10:19:32 +0000 (11:19 +0100)
The SPOP_CF_ERROR flag is now set on connection error only. It was also set
on some demux failures. But it is not mandatory because the connection is
closed anyway. And it is handy to have a flag dedicated to tcp connection
error. It was the original purpose of this flag.

This patch could be backported to 3.1 to ease future backports.

src/mux_spop.c

index 5fb6a24409172e5d7f93c8f5d5490ed429ebc5b5..e5b935c366a34171d70730842ebcb54569f8938d 100644 (file)
@@ -1726,7 +1726,6 @@ static int spop_conn_handle_hello(struct spop_conn *spop_conn)
        return 1;
   fail:
        spop_conn->state = SPOP_CS_CLOSED;
-       spop_conn->flags |= SPOP_CF_ERROR;
        TRACE_STATE("switching to CLOSED", SPOP_EV_RX_FRAME|SPOP_EV_RX_HELLO, spop_conn->conn);
        TRACE_DEVEL("leaving on error", SPOP_EV_RX_FRAME|SPOP_EV_RX_HELLO|SPOP_EV_SPOP_CONN_ERR, spop_conn->conn);
        return 0;
@@ -1839,7 +1838,6 @@ static int spop_conn_handle_disconnect(struct spop_conn *spop_conn)
        return 1;
   fail:
        spop_conn->state = SPOP_CS_CLOSED;
-       spop_conn->flags |= SPOP_CF_ERROR;
        TRACE_STATE("switching to CLOSED", SPOP_EV_RX_FRAME|SPOP_EV_RX_DISCO, spop_conn->conn);
        TRACE_DEVEL("leaving on error", SPOP_EV_RX_FRAME|SPOP_EV_RX_DISCO|SPOP_EV_SPOP_CONN_ERR, spop_conn->conn);
        return 0;