aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-data-wrapper.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-data-wrapper.c
parentf073038b91db7859f22c240c82226e4741228a7f (diff)
downloadgsoc2013-evolution-41694524a6b39908c8c7a5e298f252c488416afd.tar
gsoc2013-evolution-41694524a6b39908c8c7a5e298f252c488416afd.tar.gz
gsoc2013-evolution-41694524a6b39908c8c7a5e298f252c488416afd.tar.bz2
gsoc2013-evolution-41694524a6b39908c8c7a5e298f252c488416afd.tar.lz
gsoc2013-evolution-41694524a6b39908c8c7a5e298f252c488416afd.tar.xz
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-data-wrapper.c')
-rw-r--r--camel/camel-data-wrapper.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/camel/camel-data-wrapper.c b/camel/camel-data-wrapper.c
index cd4fcce7de..6f6aac6a16 100644
--- a/camel/camel-data-wrapper.c
+++ b/camel/camel-data-wrapper.c
@@ -145,9 +145,14 @@ static void
my_set_input_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
{
g_assert (data_wrapper);
+
+ if (data_wrapper->input_stream)
+ gtk_object_unref (GTK_OBJECT (data_wrapper->input_stream));
+
data_wrapper->input_stream = stream;
+
if (!data_wrapper->output_stream && stream)
- data_wrapper->output_stream = stream;
+ my_set_output_stream (data_wrapper, stream);
if (stream)
gtk_object_ref (GTK_OBJECT (stream));
@@ -186,6 +191,10 @@ static void
my_set_output_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
{
g_assert (data_wrapper);
+
+ if (data_wrapper->output_stream)
+ gtk_object_unref (GTK_OBJECT (data_wrapper->output_stream));
+
data_wrapper->output_stream = stream;
if (stream)
gtk_object_ref (GTK_OBJECT (stream));
@@ -251,6 +260,11 @@ my_write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
output_stream = camel_data_wrapper_get_output_stream (data_wrapper);
+ if (!output_stream)
+ return;
+
+ camel_stream_reset (output_stream);
+
while (!camel_stream_eos (output_stream)) {
nb_read = camel_stream_read (output_stream, tmp_buf, 4096);
nb_written = 0;