cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: unified asynch resolver backends

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 17 Feb 2011 20:02:32 +0100 (CET)

On Thu, 17 Feb 2011, Julien Chaffraix wrote:

> I had a question about this change (from patch 0001):
>
> + if(ARES_EDESTRUCTION == status)
> + /* when this ares handle is getting destroyed, the 'arg' pointer may not
> + be valid so only defer it when we know the 'status' says its fine! */
> + return;
> +
> + res = (struct ResolverResults *)conn->async.os_specific;
>
> It looks like if ARES_EDESTRUCTION == status your change doesn't update
> res->num_pending anymore. Is this intended?

I'll have to double-check that, but I believe it is safe. The
ARES_EDESTRUCTION is passed to the callback when the ares channel is being
torned down, so there's no need for any "num_pending" logic in that case.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-02-17