cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: blocking on dns resolving

From: Daniel Stenberg <daniel_at_haxx.se>
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 (https://github.com/larroy/mycelium) 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.

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