From 2d2bc8b5b3d83032c775ee3d50ceb724df11a245 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Tue, 27 Apr 2010 14:46:54 -0500 Subject: gatio: Kill the reader when no more space --- gatchat/gatio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gatchat/gatio.c b/gatchat/gatio.c index 964bc057..1aa23344 100644 --- a/gatchat/gatio.c +++ b/gatchat/gatio.c @@ -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; } -- cgit v1.2.3