diff --git a/lib/multiif.h b/lib/multiif.h index e61c5c6f2c9fd0a80d2a7a608357d944b6dd2c16..15163da985d67889ca51d5d0bcecfa35b3bc2dbe 100644 --- a/lib/multiif.h +++ b/lib/multiif.h @@ -30,6 +30,8 @@ #define MULTI_TIMEOUT_INACCURACY 3000 #endif +#define MULTI_TIMEOUT_INACCURACY_MS (MULTI_TIMEOUT_INACCURACY / 1000) + /* * Prototypes for library-wide functions provided by multi.c */ diff --git a/lib/transfer.c b/lib/transfer.c index 533e394b6bff6e6e66d1393210368c6fe3a708ee..e3194415b7bcbf7cdf7fe761ded7d8ef04c14637 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -1309,10 +1309,11 @@ CURLcode Curl_pretransfer(struct SessionHandle *data) Curl_pgrsStartNow(data); if(data->set.timeout) - Curl_expire(data, data->set.timeout); + Curl_expire(data, data->set.timeout + MULTI_TIMEOUT_INACCURACY_MS); if(data->set.connecttimeout) - Curl_expire(data, data->set.connecttimeout); + Curl_expire(data, data->set.connecttimeout + + MULTI_TIMEOUT_INACCURACY_MS); /* In case the handle is re-used and an authentication method was picked in the session we need to make sure we only use the one(s) we now