cURL / Mailing Lists / curl-library / Single Mail


Patch Submission Agaisnt 7.21.7: Socket options for connection timeouts

From: David Chappelle <>
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.



List admin:

Received on 2011-07-15