Re: About tny-mime-part-write-to-stream



Felipe Erias Morandeira wrote:
Hi,

the attached patch adds a return value to the functions
tny_mime_part_write_to_stream and tny_mime_part_decode_to_stream, so
they return -1 if there was an error, or the number of bytes transferred
otherwise. The implementation use the output of the underlying functions
(i.e. camel_data_wrapper_decode_to_stream) to get that value.

That's correct behaviour indeed.

void
tny_mime_part_write_to_stream (TnyMimePart *self, TnyStream *stream)

Don't you want to adapt tny_mime_part_decode_to_stream too then?


Since this function deals with data I/O, I think that it would be good
to add a return value or a GError parameter, so we can get notified in
case there is some error and inform the user.

What are your thoughts about it?

What about adding a GError to write_to_stream and decode_to_stream and returning -1 in case of error. In the implementations of write_to_stream and decode_to_stream you put perror in the GError's description.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]