summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gatchat/gatio.c4
1 files changed, 4 insertions, 0 deletions
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;
}