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



You are not fixing the TnyCamelBsMimePart type with this patch. That
should give you a warning at least. Please fix that one too.



On Thu, 2007-12-20 at 19:09 +0100, Felipe Erias Morandeira wrote:
> Hello,
> 
> This patch modifies tny_camel_mime_part_write_to_stream and
> tny_camel_mime_part_write_to_stream_default so they have the following
> signature:
>         
>         static gssize
>         tny_camel_mime_part_write_to_stream (
>             TnyMimePart *self, TnyStream *stream, GError **err)
>         
>         static gssize
>         tny_camel_mime_part_write_to_stream_default (
>             TnyMimePart *self, TnyStream *stream, GError **err)
> 
> 
> 
> O Xov, 20-12-2007 ás 11:23 +0100, Philip Van Hoof escribiu:
> > 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.
> > 
> > 
-- 
Philip Van Hoof, freelance software developer
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
http://pvanhoof.be/blog
http://codeminded.be






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