Subject: Re: c-ares re-entrancy patch, 2006-09-30

Re: c-ares re-entrancy patch, 2006-09-30

From: William Ahern <william_at_25thandclement.com>
Date: Tue, 17 Oct 2006 11:45:31 -0700

On Tue, Oct 17, 2006 at 03:39:51PM +0200, Daniel Stenberg wrote:
<snip>
> If we want to support killing the handle in the callback, I would favour a
> much simpler approach code-wise, that would just mark the handle for
> deletion when ares_destroy is called from within a callback, and then check
> that marked-to-be-destroyed flag just before ares_process() returns and if
> set kill it there for real. I don't like the complicated macros your patch
> introduces, as I've had to reread them multiple times just to figure out
> what they do and how they work.

Ok. I'll try to come up with a patch to do this.

But, realize that I use this method because I uses malloc replacements in
all my code (using libarena), and flagging the channel in this manner
doesn't work, because the memory would already be invalid. I was hoping to
one day also patch c-ares to support this (similar to Lua, which support a
malloc replacement with a context pointer, not a global hook).

But, I agree employing a simple flag should be much simpler.
Received on 2006-10-17