From 293b8f7530065445c965e1b62493cdbd32829e48 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Tue, 16 Apr 2024 08:22:36 +0200 Subject: [PATCH] MINOR: mux-pt: Test conn flags instead of sedesc ones to perform a full close In .shutr and .shutw callback functions, we must rely on the connection flags (CO_FL_SOCK_RD_SH/WR_SH) to decide to fully close the connection instead of using sedesc flags. At the end, for the PT multiplexer, it is equivalent. But it is more logicial and consistent this way. --- src/mux_pt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/mux_pt.c b/src/mux_pt.c index 832d18980..77fd9897d 100644 --- a/src/mux_pt.c +++ b/src/mux_pt.c @@ -475,7 +475,7 @@ static void mux_pt_shutr(struct stconn *sc, enum co_shr_mode mode) (mode == CO_SHR_DRAIN)); else if (mode == CO_SHR_DRAIN) conn_ctrl_drain(conn); - if (se_fl_test(ctx->sd, SE_FL_SHW)) + if (conn->flags & CO_FL_SOCK_WR_SH) conn_full_close(conn); TRACE_LEAVE(PT_EV_STRM_SHUT, conn, sc); @@ -484,14 +484,13 @@ static void mux_pt_shutr(struct stconn *sc, enum co_shr_mode mode) static void mux_pt_shutw(struct stconn *sc, enum co_shw_mode mode) { struct connection *conn = __sc_conn(sc); - struct mux_pt_ctx *ctx = conn->ctx; TRACE_ENTER(PT_EV_STRM_SHUT, conn, sc); if (conn_xprt_ready(conn) && conn->xprt->shutw) conn->xprt->shutw(conn, conn->xprt_ctx, (mode == CO_SHW_NORMAL)); - if (!se_fl_test(ctx->sd, SE_FL_SHR)) + if (!(conn->flags & CO_FL_SOCK_RD_SH)) conn_sock_shutw(conn, (mode == CO_SHW_NORMAL)); else conn_full_close(conn);