From: Olivier Houchard Date: Fri, 30 Nov 2018 12:17:48 +0000 (+0100) Subject: BUG/MEDIUM: mux_pt: Don't try to send if handshake is not done. X-Git-Tag: v1.9-dev9~101 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b72d98a619442cd52d86bb4786b867f1aed4c8a7;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: mux_pt: Don't try to send if handshake is not done. While it is true the SSL code will do the right thing if the SSL handshake is not done, we have other types of handshake to deal with (proxy protocol, netscaler, ...). For those we definitively don't want to try to send data before it's done. All handshakes but SSL will go through the mux_pt, so in mux_pt_snd_buf, don't try to send while a handshake is pending. --- diff --git a/src/mux_pt.c b/src/mux_pt.c index 1f0f3e5a0d..9dec132163 100644 --- a/src/mux_pt.c +++ b/src/mux_pt.c @@ -253,7 +253,11 @@ static size_t mux_pt_rcv_buf(struct conn_stream *cs, struct buffer *buf, size_t /* Called from the upper layer, to send data */ static size_t mux_pt_snd_buf(struct conn_stream *cs, struct buffer *buf, size_t count, int flags) { - size_t ret = cs->conn->xprt->snd_buf(cs->conn, buf, count, flags); + size_t ret; + + if (cs->conn->flags & CO_FL_HANDSHAKE) + return 0; + ret = cs->conn->xprt->snd_buf(cs->conn, buf, count, flags); if (ret > 0) b_del(buf, ret);