[evolution-data-server] camel_stream_eos() returns FALSE even when at the end of stream
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] camel_stream_eos() returns FALSE even when at the end of stream
- Date: Mon, 14 Oct 2013 19:39:44 +0000 (UTC)
commit 028a7b383af8adbd72d03b203b3c5e1fb6783c35
Author: Milan Crha <mcrha redhat com>
Date: Mon Oct 14 21:36:28 2013 +0200
camel_stream_eos() returns FALSE even when at the end of stream
That breaks stream copy routine like camel_stream_write_to_stream(),
which relies on the camel_stream_eos().
camel/camel-stream.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/camel/camel-stream.c b/camel/camel-stream.c
index be5f2ca..01fcf80 100644
--- a/camel/camel-stream.c
+++ b/camel/camel-stream.c
@@ -138,6 +138,8 @@ stream_read (CamelStream *stream,
g_object_unref (base_stream);
}
+ stream->eos = n_bytes_read <= 0;
+
return n_bytes_read;
}
@@ -157,6 +159,7 @@ stream_write (CamelStream *stream,
GOutputStream *output_stream;
output_stream = g_io_stream_get_output_stream (base_stream);
+ stream->eos = FALSE;
n_bytes_written = g_output_stream_write (
output_stream, buffer, n, cancellable, error);
@@ -273,6 +276,7 @@ stream_seek (GSeekable *seekable,
base_stream = camel_stream_ref_base_stream (stream);
if (G_IS_SEEKABLE (base_stream)) {
+ stream->eos = FALSE;
success = g_seekable_seek (
G_SEEKABLE (base_stream),
offset, type, cancellable, error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]