Flush the protocol output buffer when it fills up

Original patch from bnf.

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
This commit is contained in:
Corentin Chary 2011-06-10 10:24:23 +02:00 committed by Kristian Høgsberg
parent d7569d46c5
commit d8f2e5d6ab

View file

@ -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)