cURL / Mailing Lists / curl-library / Single Mail


Re: blocking on dns resolving

From: Daniel Stenberg <>
Date: Sun, 18 Dec 2011 19:34:34 +0100 (CET)

On Sun, 18 Dec 2011, Pedro Larroy wrote:

> After some flustration with blocking on dns requests while using the multi
> interface with libevent ( I investigated
> how curl uses ares and I came to the conclusion that the design of
> asyn-ares.c is very limiting.

Can you elaborate on when exactly it is "very limiting" ?

> What's the point of having all the goodies of the multi interface to use
> epoll etc, when waitperform function in asyn-ares.c just polls waiting for
> DNS queries to finish?

It doesn't. The multi interface tells your app about the socket c-ares uses
and your app waits for actions on that socket before it tells libcurl to work
on it.

> I think the proper way would be to expose the resolving sockets up to the
> multi interface so the whole system is really asynchronous. Is there any
> reason why it wasn't done this way?

It _is_ done like that. There are just a few exceptions to that rule. They are
documented and will hopefully all be fixed one by one until gone one day in
the future.

List admin:
Received on 2011-12-18