aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-08-22 00:20:14 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-08-22 00:20:14 +0800
commit8cb1ce04ac5efcc71680e8da2843535244fd2ec3 (patch)
tree88ec9870f98786b8ca66ac10f7487e859c956d3b
parente9d518e362ce8b273d4b2281c92b77cee16b5d97 (diff)
downloadgsoc2013-evolution-8cb1ce04ac5efcc71680e8da2843535244fd2ec3.tar
gsoc2013-evolution-8cb1ce04ac5efcc71680e8da2843535244fd2ec3.tar.gz
gsoc2013-evolution-8cb1ce04ac5efcc71680e8da2843535244fd2ec3.tar.bz2
gsoc2013-evolution-8cb1ce04ac5efcc71680e8da2843535244fd2ec3.tar.lz
gsoc2013-evolution-8cb1ce04ac5efcc71680e8da2843535244fd2ec3.tar.xz
gsoc2013-evolution-8cb1ce04ac5efcc71680e8da2843535244fd2ec3.tar.zst
gsoc2013-evolution-8cb1ce04ac5efcc71680e8da2843535244fd2ec3.zip
Don't poke wrapper->stream directly, use
2003-08-21 Jeffrey Stedfast <fejj@ximian.com> * camel-data-wrapper.c (decode_to_stream): Don't poke wrapper->stream directly, use camel_data_wrapper_write_to_stream() instead as this simplifies things and makes the imap data wrapper implementation Just Work (tm). * providers/imap/camel-imap-wrapper.c: changed prototype of write_to_stream() to return ssize_t. svn path=/trunk/; revision=22325
-rw-r--r--camel/ChangeLog10
-rw-r--r--camel/camel-data-wrapper.c18
-rw-r--r--camel/providers/imap/camel-imap-wrapper.c2
3 files changed, 14 insertions, 16 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 20904fac03..701114b00a 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,13 @@
+2003-08-21 Jeffrey Stedfast <fejj@ximian.com>
+
+ * camel-data-wrapper.c (decode_to_stream): Don't poke
+ wrapper->stream directly, use camel_data_wrapper_write_to_stream()
+ instead as this simplifies things and makes the imap data wrapper
+ implementation Just Work (tm).
+
+ * providers/imap/camel-imap-wrapper.c: changed prototype of
+ write_to_stream() to return ssize_t.
+
2003-08-20 Jeffrey Stedfast <fejj@ximian.com>
* providers/imap/camel-imap-wrapper.c (imap_wrapper_hydrate): Make
diff --git a/camel/camel-data-wrapper.c b/camel/camel-data-wrapper.c
index 80575c96e8..7230f77d6d 100644
--- a/camel/camel-data-wrapper.c
+++ b/camel/camel-data-wrapper.c
@@ -176,18 +176,7 @@ decode_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
CamelStream *fstream;
ssize_t ret;
- if (data_wrapper->stream == NULL) {
- g_warning("data_wrapper->stream is NULL in decode_to_stream()");
- return -1;
- }
-
- CAMEL_DATA_WRAPPER_LOCK (data_wrapper, stream_lock);
- if (camel_stream_reset (data_wrapper->stream) == -1) {
- CAMEL_DATA_WRAPPER_UNLOCK (data_wrapper, stream_lock);
- return -1;
- }
-
- fstream = (CamelStream *) camel_stream_filter_new_with_stream (data_wrapper->stream);
+ fstream = (CamelStream *) camel_stream_filter_new_with_stream (stream);
switch (data_wrapper->encoding) {
case CAMEL_MIME_PART_ENCODING_BASE64:
@@ -216,11 +205,10 @@ decode_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
camel_object_unref (filter);
}
- ret = camel_stream_write_to_stream (fstream, stream);
+ ret = camel_data_wrapper_write_to_stream (data_wrapper, fstream);
+ camel_stream_flush (fstream);
camel_object_unref (fstream);
- CAMEL_DATA_WRAPPER_UNLOCK (data_wrapper, stream_lock);
-
return ret;
}
diff --git a/camel/providers/imap/camel-imap-wrapper.c b/camel/providers/imap/camel-imap-wrapper.c
index f2f87d5409..2cb07b3012 100644
--- a/camel/providers/imap/camel-imap-wrapper.c
+++ b/camel/providers/imap/camel-imap-wrapper.c
@@ -43,7 +43,7 @@ static CamelDataWrapperClass *parent_class = NULL;
/* Returns the class for a CamelDataWrapper */
#define CDW_CLASS(so) CAMEL_DATA_WRAPPER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-static int write_to_stream (CamelDataWrapper *imap_wrapper, CamelStream *stream);
+static ssize_t write_to_stream (CamelDataWrapper *imap_wrapper, CamelStream *stream);
static void
camel_imap_wrapper_class_init (CamelImapWrapperClass *camel_imap_wrapper_class)