cURL / Mailing Lists / curl-library / Single Mail

curl-library

Issue with CURL detecting network outage

From: Jogeshwar Karthik Akundi <ajkarthik_at_gmail.com>
Date: Wed, 16 Dec 2009 11:42:33 +0530

Hi friends,
I have a problem in using libCurl.

curl is not detecting network outage.

OS: Mac OS X 10.5.8 (Leopard)
Curl Version Info: libcurl/7.19.3 OpenSSL/0.9.7l zlib/1.2.3 - custom build.

Following is the scenario.
Client uses CURL to connect to server using Connect_Only option.
While the connection is running, if network cable is removed, the disconnect
is not being detected.
I use select() to verify readibility/writability on the socket and use
curl_easy_read/write to receive/send data.
when using the socket descriptor in read/write sets, select doesn't return
FD_ISSET. it only times out.
I have some heartbeat packets which are always sent, so I tried to skip
select and force sending data to CURL if buffers are available.
Then curl_easy_send returns success. It is able to send packets of 20 bytes
(verified only a few packets though) without errors, while I hold the
network cable in my hand.
However, this disconnect is not being detected for a long while (waited for
10 minutes in once case and then quit the application).

In the same case, we get an error immediately on windows. This issue is OSX
specific (atleast for me here).
Any pointers towards this would be of great help. I am trying to write a
minimal program which can reproduce this.
Once it is done, I shall post it also.

Thanks
Jogeshwar Karthik Akundi

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