]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: ssl: don't abort after sending 16kB
authorWilly Tarreau <w@1wt.eu>
Wed, 25 Oct 2017 13:34:39 +0000 (15:34 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 25 Oct 2017 13:52:41 +0000 (15:52 +0200)
SSL records are 16kB max. When trying to send larger data chunks at once,
SSL_read() only processes 16kB and ssl_sock_from_buf() believes it means
the system buffers are full, which is not the case, contrary to raw_sock.
This is particularly noticeable with HTTP/2 when using a 64kB buffer with
multiple streams, as the mux buffer can start to fill up pretty quickly
in this situation, slowing down the data delivery.

src/ssl_sock.c

index 39063ecf15651f8351526230d51edebe19dc7fcd..3afcd52449420d9a020ef39957e7870dde181764 100644 (file)
@@ -5009,10 +5009,6 @@ static int ssl_sock_from_buf(struct connection *conn, struct buffer *buf, int fl
                        if (likely(buffer_empty(buf)))
                                /* optimize data alignment in the buffer */
                                buf->p = buf->data;
-
-                       /* if the system buffer is full, don't insist */
-                       if (ret < try)
-                               break;
                }
                else {
                        ret = SSL_get_error(conn->xprt_ctx, ret);