From 2392d67981785dac17f56305f8ee3fc0b5884694 Mon Sep 17 00:00:00 2001 From: bertrand Date: Fri, 3 Mar 2000 02:54:25 +0000 Subject: don't forget to set the state to 0 after 3. (my_read_encode): don't forget 2000-03-02 bertrand * camel-stream-b64.c (my_read_encode): don't forget to set the state to 0 after 3. (my_read_encode): don't forget to encode, even in state 3. * camel-simple-data-wrapper.c: static functions are prefixed with my_ instead of _ * camel-multipart.c: static functions are prefixed with my_ instead of _ (my_write_to_stream): commented. (my_write_to_stream): warning in case the boudary is set but is a zero length string. * camel-mime-part.c (camel_mime_part_encoding_from_string): remove debug trace. * camel-mime-part.c: Replaced all static functions with name begining with _ by the same name begining with "my_" to prevent the possible conflicts with system symbols Dan warned us about. Mime mail generation works now, at least with b64 encoding. QP needs to be done now. svn path=/trunk/; revision=2016 --- camel/camel-stream-b64.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'camel/camel-stream-b64.c') diff --git a/camel/camel-stream-b64.c b/camel/camel-stream-b64.c index df4f755fac..eb99f40058 100644 --- a/camel/camel-stream-b64.c +++ b/camel/camel-stream-b64.c @@ -356,7 +356,8 @@ my_read_encode (CamelStream *stream, * read to write in the stream */ if (status->state == 3) { - buffer [j++] = status->keep; + buffer [j++] = six_bits_to_char [status->keep]; + status->state = 0; status->keep = 0; status->line_length++; break; @@ -418,7 +419,7 @@ my_read_encode (CamelStream *stream, * we are at the end of the input stream * we must pad the output with '='. */ - + printf ("%d\n", status->end_state); while ((jend_state != 6)) { if (status->end_state == 5) { @@ -465,7 +466,6 @@ my_read_encode (CamelStream *stream, } - status->end_state++; break; @@ -570,8 +570,9 @@ camel_stream_b64_write_to_stream (CamelStreamB64 *stream_b64, while (!camel_stream_eos (CAMEL_STREAM (stream_b64))) { nb_read = camel_stream_read (CAMEL_STREAM (stream_b64), tmp_buf, 4096); nb_written = 0; + while (nb_written < nb_read) - nb_written += camel_stream_write (output_stream, tmp_buf, nb_read); + nb_written += camel_stream_write (output_stream, tmp_buf + nb_written, nb_read - nb_written); } } -- cgit v1.2.3