curl / Mailing Lists / curl-library / 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: Curl timeout option in milliseconds

From: karthikeyan Sivakkumar via curl-library <>
Date: Sat, 16 Nov 2019 19:20:00 +0530

Hi Daniel,

Correct me if I am wrong. Using
 --enable-ares=<ares installation path> should help to achieve timeout <

Also if there is any documentation on installing c-ares and building
libcurl with c-ares, please share here.

Thanks and regards
Karthikeyan T S.

On Sat, 16 Nov 2019, 16:53 karthikeyan Sivakkumar, <>

> Hi Daniel,
> Thanks for the clarification. Apologies for missing out to answer your
> backend resolver query. Libcurl build is actually done by our application
> product and I donot have the info with me.
> Will check with them.
> I did check your blog on libcurls-name-resolving and got some info about
> the c-ares and threaded solutions for asynchronous name resolving.
> Looking at curl docs, I learnt about the - - disable-ares option to
> disable C-ARES support thereby reducing libcurl size. I can check with my
> product team if this option was used in our libcurl build.
> Kindly guide me if this would help. Also, if there is anyother way to
> enable the async/threaded resolving, kindly let me know the same too.
> Thanks and regards,
> Karthikeyan T S.
> On Fri, 15 Nov 2019, 19:24 Daniel Stenberg, <> wrote:
>> > Cases 1, 2 and 3 work fine but timeout occurs wrongly in cases 4 and 5.
>> > Please correct me if my understanding here is wrong.
>> Didn't this change the behavior? Your original statement said sub second
>> timeouts still took a full second but in this output it looks like they
>> failed
>> completely.
>> You also never answered my question about what resolver backend your
>> build is
>> using but I think that the above behavior answers it for me with enough
>> certainty:
>> I think libcurl returns an error for you due to this condition:
>> ... this is because you've built libcurl to use the synchronous name
>> resolver
>> and we can only time-out that with signal() and that function only has
>> integer
>> second resolution. If you ask for a shorter timeout, that can't be
>> fullfilled.
>> libcurl defaults to using the threaded resolver these days which will
>> fire up
>> the resolver in a sepearate thread that can be abandonded easier and in
>> less
>> than a second.
>> --
>> / | Get the best commercial curl support there is -
>> from me
>> | Private help, bug fixes, support, ports, new features
>> |

Received on 2019-11-16