MINOR: mux-pt: take care of CS_SHR_DRAIN in shutr()

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.
This commit is contained in:
Willy Tarreau 2020-12-11 11:07:19 +01:00
parent 6aee5b9a4c
commit 7d7b11cf93

View 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);
}