]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: mux-pt: Don't always set a final error on SE on the sending path
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 5 Oct 2022 09:01:56 +0000 (11:01 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 17 Nov 2022 13:33:15 +0000 (14:33 +0100)
SE_FL_ERROR must be set on the SE descriptor only if EOS was already
reported. So call se_fl_set_error() function to properly the
ERR_PENDING/ERROR flags. It is not really a bug because the mux-pt is really
simple. But it is better to do it now the right way.

src/mux_pt.c

index baa67cea45d602ede0b119757f3e4f18e589a9f8..86a1f2362e766b43a4b5182ccde2b07180f44114 100644 (file)
@@ -557,7 +557,7 @@ static size_t mux_pt_snd_buf(struct stconn *sc, struct buffer *buf, size_t count
                b_del(buf, ret);
 
        if (conn->flags & CO_FL_ERROR) {
-               se_fl_set(ctx->sd, SE_FL_ERROR);
+               se_fl_set_error(ctx->sd);
                TRACE_DEVEL("error on connection", PT_EV_TX_DATA|PT_EV_CONN_ERR, conn, sc);
        }
 
@@ -625,7 +625,7 @@ static int mux_pt_snd_pipe(struct stconn *sc, struct pipe *pipe)
        ret = conn->xprt->snd_pipe(conn, conn->xprt_ctx, pipe);
 
        if (conn->flags & CO_FL_ERROR) {
-               se_fl_set(ctx->sd, SE_FL_ERROR);
+               se_fl_set_error(ctx->sd);
                TRACE_DEVEL("error on connection", PT_EV_TX_DATA|PT_EV_CONN_ERR, conn, sc);
        }