diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2003-08-22 00:20:14 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2003-08-22 00:20:14 +0800 |
commit | 8cb1ce04ac5efcc71680e8da2843535244fd2ec3 (patch) | |
tree | 88ec9870f98786b8ca66ac10f7487e859c956d3b /camel/camel-data-wrapper.c | |
parent | e9d518e362ce8b273d4b2281c92b77cee16b5d97 (diff) | |
download | gsoc2013-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
Diffstat (limited to 'camel/camel-data-wrapper.c')
-rw-r--r-- | camel/camel-data-wrapper.c | 18 |
1 files changed, 3 insertions, 15 deletions
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; } |