cURL / Mailing Lists / curl-library / Single Mail

curl-library

Patch Submission Agaisnt 7.21.7: Socket options for connection timeouts

From: David Chappelle <David.Chappelle_at_kaleidescape.com>
Date: Fri, 15 Jul 2011 09:38:19 -0700

Please find attached the patch submission for:

libcurl, at least as of version 7.21.7, does not properly implement the timeout option. Basically it checks the timeout every time the send()/recv() call returns, and abandons the operation if the timeout has elapsed. If there is a network partition between the client and the server, then the recv() call will block indefinitely and the requested timeout is not honoured. The fix is to use the SNDTIMEO and RCVTIMEO socket options to set timeouts at the socket layer so that the APIs will return to libcurl and libcurl can decide what to do. I've made these changes to achieve this in the attached patch.

I suspect that there will have to be some additional code (macro checks) added to check for the existence of 'struct timeval' and 'setsockopt' to make this patch completely compatible with the curl library build.

Regards,

Dave

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html

Received on 2011-07-15