summaryrefslogtreecommitdiff
path: root/lib/file.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2017-07-29 16:35:09 +0200
committerDaniel Stenberg <daniel@haxx.se>2017-07-29 16:35:09 +0200
commit0bd2d077afbac413d52980a943cf4ac241956a7a (patch)
treed0bb92cbcc2fe85c2fb1f9e13df2b76be28cf8f9 /lib/file.c
parent171f8ded26d2845ef358c62f6e95ec34468349ae (diff)
downloadcurl-bagder/now-remade.tar.gz
now: update 'now' as part of the easy handle instead of local variablesbagder/now-remade
... as the mix of both passing in current time and figuring it out locally sometimes made "now" move in time in unexpected ways. Curl_timeleft() got an updated prototype. The old defines for Curl_tvnow() and Curl_tvdiff() are now removed. Renamed the conn->new member to setup_time and fixed its use somewhat. Moved the 'now' field from the SingleRequest struct within the easy handle to the struct UrlState.
Diffstat (limited to 'lib/file.c')
-rw-r--r--lib/file.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/file.c b/lib/file.c
index bd426eac2..6b2f05a72 100644
--- a/lib/file.c
+++ b/lib/file.c
@@ -398,8 +398,10 @@ static CURLcode file_upload(struct connectdata *conn)
if(Curl_pgrsUpdate(conn))
result = CURLE_ABORTED_BY_CALLBACK;
- else
- result = Curl_speedcheck(data, Curl_tvnow());
+ else {
+ data->state.now = curlx_tvnow();
+ result = Curl_speedcheck(data, data->state.now);
+ }
}
if(!result && Curl_pgrsUpdate(conn))
result = CURLE_ABORTED_BY_CALLBACK;
@@ -583,8 +585,10 @@ static CURLcode file_do(struct connectdata *conn, bool *done)
if(Curl_pgrsUpdate(conn))
result = CURLE_ABORTED_BY_CALLBACK;
- else
- result = Curl_speedcheck(data, Curl_tvnow());
+ else {
+ data->state.now = curlx_tvnow();
+ result = Curl_speedcheck(data, data->state.now);
+ }
}
if(Curl_pgrsUpdate(conn))
result = CURLE_ABORTED_BY_CALLBACK;