- Michael Wallner provided a patch that adds support for CURLOPT_TIMEOUT_MS
and CURLOPT_CONNECTTIMEOUT_MS that, as their names should hint, do the timeouts with millisecond resolution instead. The only restriction to that is the alarm() (sometimes) used to abort name resolves as that uses full seconds. I fixed the FTP response timeout part of the patch. Internally we now count and keep the timeouts in milliseconds but it also means we multiply set timeouts with 1000. The effect of this is that no timeout can be set to more than 2^31 milliseconds (on 32 bit systems), which equals 24.86 days. We probably couldn't before either since the code did *1000 on the timeout values on several places already.
This commit is contained in:
@@ -1176,9 +1176,9 @@ struct UserDefined {
|
||||
|
||||
void *progress_client; /* pointer to pass to the progress callback */
|
||||
void *ioctl_client; /* pointer to pass to the ioctl callback */
|
||||
long timeout; /* in seconds, 0 means no timeout */
|
||||
long connecttimeout; /* in seconds, 0 means no timeout */
|
||||
long ftp_response_timeout; /* in seconds, 0 means no timeout */
|
||||
long timeout; /* in milliseconds, 0 means no timeout */
|
||||
long connecttimeout; /* in milliseconds, 0 means no timeout */
|
||||
long ftp_response_timeout; /* in milliseconds, 0 means no timeout */
|
||||
curl_off_t infilesize; /* size of file to upload, -1 means unknown */
|
||||
long low_speed_limit; /* bytes/second */
|
||||
long low_speed_time; /* number of seconds */
|
||||
|
Reference in New Issue
Block a user