mirror of
https://github.com/curl/curl.git
synced 2026-08-25 12:43:37 +03:00
file: make speedcheck use current time for checks
... as it would previously just get the "now" timestamp before the transfer starts and then not update it again. Closes #1550
This commit is contained in:
parent
f7ee701c61
commit
68c6dcb2cb
1 changed files with 2 additions and 4 deletions
|
|
@ -311,7 +311,6 @@ static CURLcode file_upload(struct connectdata *conn)
|
||||||
size_t nread;
|
size_t nread;
|
||||||
size_t nwrite;
|
size_t nwrite;
|
||||||
curl_off_t bytecount = 0;
|
curl_off_t bytecount = 0;
|
||||||
struct timeval now = Curl_tvnow();
|
|
||||||
struct_stat file_stat;
|
struct_stat file_stat;
|
||||||
const char *buf2;
|
const char *buf2;
|
||||||
|
|
||||||
|
|
@ -399,7 +398,7 @@ static CURLcode file_upload(struct connectdata *conn)
|
||||||
if(Curl_pgrsUpdate(conn))
|
if(Curl_pgrsUpdate(conn))
|
||||||
result = CURLE_ABORTED_BY_CALLBACK;
|
result = CURLE_ABORTED_BY_CALLBACK;
|
||||||
else
|
else
|
||||||
result = Curl_speedcheck(data, now);
|
result = Curl_speedcheck(data, Curl_tvnow());
|
||||||
}
|
}
|
||||||
if(!result && Curl_pgrsUpdate(conn))
|
if(!result && Curl_pgrsUpdate(conn))
|
||||||
result = CURLE_ABORTED_BY_CALLBACK;
|
result = CURLE_ABORTED_BY_CALLBACK;
|
||||||
|
|
@ -436,7 +435,6 @@ static CURLcode file_do(struct connectdata *conn, bool *done)
|
||||||
char *buf = data->state.buffer;
|
char *buf = data->state.buffer;
|
||||||
curl_off_t bytecount = 0;
|
curl_off_t bytecount = 0;
|
||||||
int fd;
|
int fd;
|
||||||
struct timeval now = Curl_tvnow();
|
|
||||||
struct FILEPROTO *file;
|
struct FILEPROTO *file;
|
||||||
|
|
||||||
*done = TRUE; /* unconditionally */
|
*done = TRUE; /* unconditionally */
|
||||||
|
|
@ -585,7 +583,7 @@ static CURLcode file_do(struct connectdata *conn, bool *done)
|
||||||
if(Curl_pgrsUpdate(conn))
|
if(Curl_pgrsUpdate(conn))
|
||||||
result = CURLE_ABORTED_BY_CALLBACK;
|
result = CURLE_ABORTED_BY_CALLBACK;
|
||||||
else
|
else
|
||||||
result = Curl_speedcheck(data, now);
|
result = Curl_speedcheck(data, Curl_tvnow());
|
||||||
}
|
}
|
||||||
if(Curl_pgrsUpdate(conn))
|
if(Curl_pgrsUpdate(conn))
|
||||||
result = CURLE_ABORTED_BY_CALLBACK;
|
result = CURLE_ABORTED_BY_CALLBACK;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue