From d8f2e5d6ab0205141e3d6c41b815cd8029bb2911 Mon Sep 17 00:00:00 2001 From: Corentin Chary Date: Fri, 10 Jun 2011 10:24:23 +0200 Subject: [PATCH] Flush the protocol output buffer when it fills up Original patch from bnf. Signed-off-by: Corentin Chary --- wayland/connection.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wayland/connection.c b/wayland/connection.c index e5893c3..0f2051a 100644 --- a/wayland/connection.c +++ b/wayland/connection.c @@ -327,6 +327,10 @@ void wl_connection_write(struct wl_connection *connection, const void *data, size_t count) { + if (connection->out.head - connection->out.tail + + count > ARRAY_LENGTH(connection->out.data)) + wl_connection_data(connection, WL_CONNECTION_WRITABLE); + wl_buffer_put(&connection->out, data, count); if (connection->out.head - connection->out.tail == count) -- 2.7.4