gatio: Kill the reader when no more space

This commit is contained in:
Denis Kenzior 2010-04-27 14:46:54 -05:00
parent f09ce13ad7
commit 2d2bc8b5b3
1 changed files with 4 additions and 0 deletions

View File

@ -115,6 +115,10 @@ static gboolean received_data(GIOChannel *channel, GIOCondition cond,
if (read_count > 0 && rbytes == 0 && err != G_IO_ERROR_AGAIN)
return FALSE;
/* We're overflowing the buffer, shutdown the socket */
if (ring_buffer_avail(io->buf) == 0)
return FALSE;
return TRUE;
}