]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-h1: Subscribe to send in h1_snd_buf() when not all data have been sent
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 20 Nov 2018 17:38:01 +0000 (18:38 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 1 Dec 2018 16:37:27 +0000 (17:37 +0100)
After a call to snd_buf, if some data remain in the channel's buffer, this means
the system buffers are full or we are unable to fully consume an HTX block for
any reason. In the last case, we need to wakeup the stream to process more data
as soon as possible. We do it subscribing to send at the end of h1_snd_buf().

src/mux_h1.c

index 534e14d79b4922ea7703b5d087f6829a5e15a6da..6c104f309ac2941d0c3668dc7808f8b1aeb246c4 100644 (file)
@@ -1807,6 +1807,12 @@ static size_t h1_snd_buf(struct conn_stream *cs, struct buffer *buf, size_t coun
                if (!b_data(buf))
                        ret = count;
        }
+
+       if (count && ret != count) {
+               if (!(h1c->wait_event.wait_reason & SUB_CAN_SEND))
+                       cs->conn->xprt->subscribe(cs->conn, SUB_CAN_SEND, &h1c->wait_event);
+       }
+
        return ret;
 }