diff options
author | Daniel Stenberg <daniel@haxx.se> | 2017-06-07 13:29:46 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2017-06-07 13:29:46 +0200 |
commit | 46da074459baa824ef406d4b0b7c2ceba57c588d (patch) | |
tree | e26fd005065f63bf1a824b9431a2a0b54018d033 /lib/file.c | |
parent | e100afb4d8697e9c5f0e4b34b3b6f2b45337e442 (diff) | |
download | curl-bagder/file-speedcheck-fix.tar.gz |
file: make speedcheck use current time for checksbagder/file-speedcheck-fix
... as it would previously just get the "now" timestamp before the
transfer starts and then not update it again.
Diffstat (limited to 'lib/file.c')
-rw-r--r-- | lib/file.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/file.c b/lib/file.c index 7bd4535a0..c804d75e1 100644 --- a/lib/file.c +++ b/lib/file.c @@ -311,7 +311,6 @@ static CURLcode file_upload(struct connectdata *conn) size_t nread; size_t nwrite; curl_off_t bytecount = 0; - struct timeval now = Curl_tvnow(); struct_stat file_stat; const char *buf2; @@ -399,7 +398,7 @@ static CURLcode file_upload(struct connectdata *conn) if(Curl_pgrsUpdate(conn)) result = CURLE_ABORTED_BY_CALLBACK; else - result = Curl_speedcheck(data, now); + result = Curl_speedcheck(data, Curl_tvnow()); } if(!result && Curl_pgrsUpdate(conn)) result = CURLE_ABORTED_BY_CALLBACK; @@ -436,7 +435,6 @@ static CURLcode file_do(struct connectdata *conn, bool *done) char *buf = data->state.buffer; curl_off_t bytecount = 0; int fd; - struct timeval now = Curl_tvnow(); struct FILEPROTO *file; *done = TRUE; /* unconditionally */ @@ -585,7 +583,7 @@ static CURLcode file_do(struct connectdata *conn, bool *done) if(Curl_pgrsUpdate(conn)) result = CURLE_ABORTED_BY_CALLBACK; else - result = Curl_speedcheck(data, now); + result = Curl_speedcheck(data, Curl_tvnow()); } if(Curl_pgrsUpdate(conn)) result = CURLE_ABORTED_BY_CALLBACK; |