]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: mux_pt: Don't try to send if handshake is not done.
authorOlivier Houchard <ohouchard@haproxy.com>
Fri, 30 Nov 2018 12:17:48 +0000 (13:17 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 1 Dec 2018 09:47:17 +0000 (10:47 +0100)
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.

src/mux_pt.c

index 1f0f3e5a0df7c9ad933be711c8734855f7ff7aa2..9dec132163b1df539505db47c77aad2429f3901d 100644 (file)
@@ -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);