aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-mime-part.c
diff options
context:
space:
mode:
authorbertrand <bertrand@helixcode.com>2000-03-04 06:26:13 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>2000-03-04 06:26:13 +0800
commit41694524a6b39908c8c7a5e298f252c488416afd (patch)
tree35a04aefd33893af9d83c872919cca2216167a89 /camel/camel-mime-part.c
parentf073038b91db7859f22c240c82226e4741228a7f (diff)
downloadgsoc2013-evolution-41694524a6b39908c8c7a5e298f252c488416afd.tar.gz
gsoc2013-evolution-41694524a6b39908c8c7a5e298f252c488416afd.tar.zst
gsoc2013-evolution-41694524a6b39908c8c7a5e298f252c488416afd.zip
use set_input_stream instead of construct_from_stream to feed the message
2000-03-03 bertrand <bertrand@helixcode.com> * providers/mbox/camel-mbox-folder.c (_get_message_by_uid): use set_input_stream instead of construct_from_stream to feed the message object. * camel-data-wrapper.c (my_write_to_stream): reset output stream. (my_set_input_stream): unref the previous input stream. use the set_output_stream for default behaviour. (my_set_output_stream): unref previous output stream. * camel-mime-part.c (my_write_content_to_stream): reset content object output stream. mbox provider now also constructs message bodies. I should have looked here first. damn. svn path=/trunk/; revision=2030
Diffstat (limited to 'camel/camel-mime-part.c')
-rw-r--r--camel/camel-mime-part.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/camel/camel-mime-part.c b/camel/camel-mime-part.c
index 57b2659ffb..4c2ecca805 100644
--- a/camel/camel-mime-part.c
+++ b/camel/camel-mime-part.c
@@ -659,14 +659,27 @@ my_get_content_object (CamelMedium *medium)
static void
my_write_content_to_stream (CamelMimePart *mime_part, CamelStream *stream)
{
- CamelMedium *medium = CAMEL_MEDIUM (mime_part);
+ CamelMedium *medium;
CamelStream *wrapper_stream;
CamelStreamB64 *stream_b64;
- CamelDataWrapper *content = medium->content;
+ CamelDataWrapper *content;
+
CAMEL_LOG_FULL_DEBUG ( "Entering CamelMimePart::_write_content_to_stream\n");
CAMEL_LOG_FULL_DEBUG ( "CamelMimePart::_write_content_to_stream, content=%p\n", content);
- if (!content) return;
+
+ g_assert (mime_part);
+
+ medium = CAMEL_MEDIUM (mime_part);
+ content = medium->content;
+
+ if (!content) {
+ content = camel_medium_get_content_object (mime_part);
+ }
+
+ if (!content) {
+ return;
+ }
switch (mime_part->encoding) {
case CAMEL_MIME_PART_ENCODING_DEFAULT:
@@ -677,6 +690,7 @@ my_write_content_to_stream (CamelMimePart *mime_part, CamelStream *stream)
case CAMEL_MIME_PART_ENCODING_BASE64:
/* encode the data wrapper output stream in base 64 ... */
wrapper_stream = camel_data_wrapper_get_output_stream (content);
+ camel_stream_reset (wrapper_stream);
stream_b64 = CAMEL_STREAM_B64 (camel_stream_b64_new_with_input_stream (wrapper_stream));
camel_stream_b64_set_mode (stream_b64, CAMEL_STREAM_B64_ENCODER);
@@ -858,8 +872,7 @@ my_set_input_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
camel_seekable_substream_new_with_seekable_stream_and_bounds (seekable_stream,
content_stream_inf_bound,
-1);
-
-
+
CAMEL_LOG_FULL_DEBUG ("CamelMimePart::set_input_stream leaving\n");
}