curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: Regarding async DNS resolver

From: Daniel Stenberg via curl-users <curl-users_at_cool.haxx.se>
Date: Mon, 15 Jul 2019 00:50:15 +0200 (CEST)

On Tue, 9 Jul 2019, Amit via curl-users wrote:

(for questions about libcurl and using it, the curl-library mailing list is
the better place)

> implementation which wakes up every 1 second and requests CURL to check all
> the ongoing requests (I.e. by calling curl_multi_perform()). So even if DNS
> was resolved within 100 msec, request will only be sent out after 1 second
> (I.e. with delay of 900 msec).

That sounds like a rather naive way to work with libcurl and will of course
cause such performance problems.

> I would like to seek your opinion/thoughts if it is good idea to implement
> a callback to notify the clients about DNS resolution ?. Also, let me know
> if there is any other available mechanism to achieve the same functionality.

if libcurl offers no socket to wait for, you should wait *a short while* and
then check again. (The curl_multi_fdset man page suggests 100 milliseconds,
but that too will be a performance loss if it resolves the host name in 2
milliseconds...)

Current libcurl versions make sure curl_multi_timeout() returns a suitable
timeout even in that situation (and will make it slowly increase if no
activity is detected over time).

-- 
  / daniel.haxx.se | Get the best commercial curl support there is - from me
                   | Private help, bug fixes, support, ports, new features
                   | https://www.wolfssl.com/contact/
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2019-07-15