cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: CURLOPT_TIMEOUT_MS < 1000 - requests not reaching server

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 22 Feb 2013 10:31:30 +0100 (CET)

On Wed, 20 Feb 2013, Rakesh Sinha wrote:

> So - adding the following option helped. 
>
> curl_setopt( $c, CURLOPT_NOSIGNAL, 1);

Yes, since the stock resolver can only be aborted with signals and we use
signal functions with full-second resolution only.

In general, I would say it is of debatable value to have a sub second timeout
when name resolving is involved as well.

> "Consider building libcurl with c-ares support to enable asynchronous DNS
> lookups, which enables nice timeouts for name resolves without signals" 
>
> My distribution comes prepackages with libcurl .  How would I know , now if
> it has been built with c-ares support though ?  

curl -V shows. But you can also use the threaded resolver to get better
timeout support so you should look for 'AsynchDNS' amoug the features -V
shows.

curl_version_info() is the programmatic way to extract the same info.

-- 
  / daniel.haxx.se

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