RE: Bug in HTRequest_setOutputStream???

> -----Original Message-----
> From: Richard Atterer [mailto:richard@list03.atterer.net]
> Sent: Wednesday, February 19, 2003 2:52 PM
> To: www-lib@w3.org
> Subject: Re: Bug in HTRequest_setOutputStream???
> 
> 
> On Wed, Feb 19, 2003 at 10:27:14AM -0600, Mark Boudreaux wrote:
> > target is allocated memory by HTStreamToChunk but then it is allocated
> > memory a second time with HTRequest_setOutputStream.
> >
> > I may be off base here but from the way I read the code
> > HTRequest_setOutputStream should be changed.
> >
> > Feedback, corrections, comments?
> 
> I don't think your suggested fix is the right solution. You're changing
> the
> behaviour of HTRequest_setOutputStream(), but IMHO the bug is in the post
> code.
> 
> If you grep for HTRequest_setOutputStream() in the code, it is used in
> lots
> of other places, and all those places rely on the fact that there will be
> no attempt to free the stream object. You'd probably get a lot of double
> free()s with the change in place. Test it with valgrind!
> 
> Maybe the post code should manually do what your changed version of
> HTRequest_setOutputStream() would have done, or (cleaner) there should be
> an alternative version, "HTRequest_setOutputStream_autoFree()".
> 
> Cheers,
> 
>   Richard
> 
> --
>   __   _
>   |_) /|  Richard Atterer     |  CS student at the Technische  |  GnuPG
> key:
>   | \/¯|  http://atterer.net  |  Universität München, Germany  |
> 0x888354F7
>   ¯ '` ¯

I am a little confused by your post.  My proposed change to HTRequest_setOutputStream() does not free the stream object.  Can you show me where you are referring to?

Thanks,
Mark

Received on Thursday, 20 February 2003 08:22:45 UTC