Subject: Re: IPv6 servers redux

Re: IPv6 servers redux

From: Gregor Jasny <jasny_at_vidsoft.de>
Date: Mon, 19 Jan 2009 15:10:14 +0100

Daniel Stenberg wrote:
> Hey, here's my update of your patch from current CVS HEAD.
>
> It struck me that the API for ares_get_servers() is not really solid. How
> would a user free the list of servers again? We can't assume that free() is
> fine on memory returned from c-ares.
>
> Would it perhaps make sense to fill in a given buffer instead of doing a
> malloc, and then do a 'too small buffer' return code if the buffer isn't
> large
> enough to hold the full list? The other solution is of course to make a
> more
> generic ares_free() function that would free the given resource. It
> could then
> be made somewhat genericly so that it can be used for future returned
> data as
> well...

I'd vote for a generic ares_free(). I'll prepare a patch and test again
this evening.

Thanks,
Gregor
Received on 2009-01-19