]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-pt: take care of CS_SHR_DRAIN in shutr()
authorWilly Tarreau <w@1wt.eu>
Fri, 11 Dec 2020 10:07:19 +0000 (11:07 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 11 Dec 2020 10:07:19 +0000 (11:07 +0100)
When the shutr() requests CS_SHR_DRAIN and there's no particular shutr
implemented on the underlying transport layer, we must drain pending data.
This is what happens when cs_drain_and_close() is called. It is important
for TCP checks to drain large responses and close cleanly.

src/mux_pt.c

index b9ad8dc67f4a8cdb5f0392a8d8ad336734b5050b..3e2d066fd510625b0db51cf59e64e8f31e899d9a 100644 (file)
@@ -247,6 +247,8 @@ static void mux_pt_shutr(struct conn_stream *cs, enum cs_shr_mode mode)
        if (conn_xprt_ready(cs->conn) && cs->conn->xprt->shutr)
                cs->conn->xprt->shutr(cs->conn, cs->conn->xprt_ctx,
                    (mode == CS_SHR_DRAIN));
+       else if (mode == CS_SHR_DRAIN)
+               conn_sock_drain(cs->conn);
        if (cs->flags & CS_FL_SHW)
                conn_full_close(cs->conn);
 }