From fb50c2ae1ad54acab577f7cf7202ae05dfa06a73 Mon Sep 17 00:00:00 2001 From: Ryan Lortie Date: Thu, 22 Jan 2009 19:00:05 +0000 Subject: [PATCH] =?UTF-8?q?Bug=20568741=20=E2=80=93=20g=5Fbuffered=5Finput?= =?UTF-8?q?=5Fstream=5Ffill=5Fasync=20doesn't=20work?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2009-01-22 Ryan Lortie Bug 568741 – g_buffered_input_stream_fill_async doesn't work * gbufferedinputstream.c (fill_async_callback): grow the buffer tail after we have successfully read data from the base stream svn path=/trunk/; revision=7827 --- gio/ChangeLog | 7 +++++++ gio/gbufferedinputstream.c | 13 +++++++++++++ 2 files changed, 20 insertions(+) diff --git a/gio/ChangeLog b/gio/ChangeLog index e5ded9767..02276f36c 100644 --- a/gio/ChangeLog +++ b/gio/ChangeLog @@ -1,3 +1,10 @@ +2009-01-22 Ryan Lortie + + Bug 568741 – g_buffered_input_stream_fill_async doesn't work + + * gbufferedinputstream.c (fill_async_callback): grow the buffer tail + after we have successfully read data from the base stream + 2009-01-20 Ryan Lortie Bug 568394 – dropping the last reference to a stream filter closes the diff --git a/gio/gbufferedinputstream.c b/gio/gbufferedinputstream.c index 4ffdff73e..a19a26eec 100644 --- a/gio/gbufferedinputstream.c +++ b/gio/gbufferedinputstream.c @@ -931,6 +931,19 @@ fill_async_callback (GObject *source_object, g_simple_async_result_set_from_error (simple, error); g_error_free (error); } + else + { + GBufferedInputStreamPrivate *priv; + GObject *object; + + object = g_async_result_get_source_object (G_ASYNC_RESULT (simple)); + priv = G_BUFFERED_INPUT_STREAM (object)->priv; + + g_assert_cmpint (priv->end + res, <=, priv->len); + priv->end += res; + + g_object_unref (object); + } /* Complete immediately, not in idle, since we're already in a mainloop callout */ g_simple_async_result_complete (simple);