mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 08:08:50 -05:00
- Based on patch provided by Jacob Moshenko, the transfer logic now properly
makes sure that when using sub-second timeouts, there's no final bad 1000ms wait. Previously, a sub-second timeout would often make the elapsed time end up the time rounded up to the nearest second (e.g. 1s for 200ms timeout)
This commit is contained in:
parent
cd465e4ada
commit
9b2cce236f
5
CHANGES
5
CHANGES
@ -7,6 +7,11 @@
|
|||||||
Changelog
|
Changelog
|
||||||
|
|
||||||
Daniel Stenberg (2 Mar 2010)
|
Daniel Stenberg (2 Mar 2010)
|
||||||
|
- Based on patch provided by Jacob Moshenko, the transfer logic now properly
|
||||||
|
makes sure that when using sub-second timeouts, there's no final bad 1000ms
|
||||||
|
wait. Previously, a sub-second timeout would often make the elapsed time end
|
||||||
|
up the time rounded up to the nearest second (e.g. 1s for 200ms timeout)
|
||||||
|
|
||||||
- Andrei Benea filed bug report #2956698 and pointed out that the
|
- Andrei Benea filed bug report #2956698 and pointed out that the
|
||||||
CURLOPT_CERTINFO feature leaked memory due to a missing OpenSSL function
|
CURLOPT_CERTINFO feature leaked memory due to a missing OpenSSL function
|
||||||
call. He provided the patch to fix it too.
|
call. He provided the patch to fix it too.
|
||||||
|
@ -26,6 +26,7 @@ This release includes the following bugfixes:
|
|||||||
o FTP timeouts after file transferred completely
|
o FTP timeouts after file transferred completely
|
||||||
o skip poll() on Interix
|
o skip poll() on Interix
|
||||||
o CURLOPT_CERTINFO memory leak
|
o CURLOPT_CERTINFO memory leak
|
||||||
|
o sub-second timeouts improvements
|
||||||
|
|
||||||
This release includes the following known bugs:
|
This release includes the following known bugs:
|
||||||
|
|
||||||
@ -36,6 +37,6 @@ advice from friends like these:
|
|||||||
|
|
||||||
Steven M. Schweda, Yang Tse, Jack Zhang, Tom Donovan, Martin Hager,
|
Steven M. Schweda, Yang Tse, Jack Zhang, Tom Donovan, Martin Hager,
|
||||||
Daniel Fandrich, Patrick Monnerat, Pat Ray, Wesley Miaw, Ben Greear,
|
Daniel Fandrich, Patrick Monnerat, Pat Ray, Wesley Miaw, Ben Greear,
|
||||||
Ryan Chan, Markus Duft, Andrei Benea
|
Ryan Chan, Markus Duft, Andrei Benea, Jacob Moshenko
|
||||||
|
|
||||||
Thanks! (and sorry if I forgot to mention someone)
|
Thanks! (and sorry if I forgot to mention someone)
|
||||||
|
@ -1067,11 +1067,11 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
|||||||
if(k->size != -1) {
|
if(k->size != -1) {
|
||||||
failf(data, "Operation timed out after %ld milliseconds with %"
|
failf(data, "Operation timed out after %ld milliseconds with %"
|
||||||
FORMAT_OFF_T " out of %" FORMAT_OFF_T " bytes received",
|
FORMAT_OFF_T " out of %" FORMAT_OFF_T " bytes received",
|
||||||
data->set.timeout, k->bytecount, k->size);
|
Curl_tvdiff(k->now, k->start), k->bytecount, k->size);
|
||||||
} else {
|
} else {
|
||||||
failf(data, "Operation timed out after %ld milliseconds with %"
|
failf(data, "Operation timed out after %ld milliseconds with %"
|
||||||
FORMAT_OFF_T " bytes received",
|
FORMAT_OFF_T " bytes received",
|
||||||
data->set.timeout, k->bytecount);
|
Curl_tvdiff(k->now, k->start), k->bytecount);
|
||||||
}
|
}
|
||||||
return CURLE_OPERATION_TIMEDOUT;
|
return CURLE_OPERATION_TIMEDOUT;
|
||||||
}
|
}
|
||||||
@ -1266,8 +1266,17 @@ Transfer(struct connectdata *conn)
|
|||||||
/* if this is the first lap and one of the file descriptors is fine
|
/* if this is the first lap and one of the file descriptors is fine
|
||||||
to work with, skip the timeout */
|
to work with, skip the timeout */
|
||||||
timeout_ms = 0;
|
timeout_ms = 0;
|
||||||
else
|
else {
|
||||||
timeout_ms = 1000;
|
if(data->set.timeout) {
|
||||||
|
timeout_ms = data->set.timeout - Curl_tvdiff(k->now, k->start);
|
||||||
|
if(timeout_ms > 1000)
|
||||||
|
timeout_ms = 1000;
|
||||||
|
else if(timeout_ms < 0)
|
||||||
|
return CURLE_OPERATION_TIMEDOUT;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
timeout_ms = 1000;
|
||||||
|
}
|
||||||
|
|
||||||
switch (Curl_socket_ready(fd_read, fd_write, timeout_ms)) {
|
switch (Curl_socket_ready(fd_read, fd_write, timeout_ms)) {
|
||||||
case -1: /* select() error, stop reading */
|
case -1: /* select() error, stop reading */
|
||||||
|
Loading…
Reference in New Issue
Block a user