diff options
author | Denis Kenzior <denkenz@gmail.com> | 2010-04-27 14:46:54 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-04-28 17:27:32 -0500 |
commit | 2d2bc8b5b3d83032c775ee3d50ceb724df11a245 (patch) | |
tree | a86586c939c80cd2b122b3bff24726a52de4a849 /gatchat/gatio.c | |
parent | f09ce13ad7615e472b5dcb19653c86db1956dd49 (diff) | |
download | ofono-2d2bc8b5b3d83032c775ee3d50ceb724df11a245.tar.bz2 |
gatio: Kill the reader when no more space
Diffstat (limited to 'gatchat/gatio.c')
-rw-r--r-- | gatchat/gatio.c | 4 |
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; } |