cURL / Mailing Lists / curl-library / Single Mail

curl-library

Need help with CURLOPT_CONNECTTIMEOUT option

From: Rajat Sharma <sharmarajat14_at_gmail.com>
Date: Tue, 22 Dec 2009 17:09:59 +0530

I am developing a linux application which makes use of HTTP for downloading
some information from a server.
I am using Curl Easy interface for same.

I have created a seperate thread for making all Http coomunications and have
taken care that curl_gloab_init() is
called when the application is single threaded.

I am using the CURLOPT_CONNECTTIMEOUT to make the http connection timeout
faster then the system default of 30 sec.

The application receives the FQDN server address from a different module
and then interacts with it using HTTP.
The issue i am facing is that if I remove the ethernet cable and then try to
do the HTTP communication. This returns resolution failed
after timeout happens, which is fine, but actuallyduring name resolution the
main thread gets blocked.

My libcurl is not compiled with c-ares library can that cause DNS resolution
to block the entire process. i tried putting the thread to sleep using
select() but this
doesn't cause the main thread to block. I am basically suspecting the
standard DNS resolutuons calls.?

Could some one please enlighten me more about this?

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