mirror of https://github.com/moparisthebest/curl
fix progress data to be updated properly for file: transfers, as reported
by Jesse Noller
This commit is contained in:
parent
59a30e6d9b
commit
2b59e90c54
|
@ -174,6 +174,7 @@ CURLcode Curl_file(struct connectdata *conn)
|
||||||
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();
|
||||||
|
|
||||||
/* get the fd from the connection phase */
|
/* get the fd from the connection phase */
|
||||||
fd = conn->proto.file->fd;
|
fd = conn->proto.file->fd;
|
||||||
|
@ -239,6 +240,8 @@ CURLcode Curl_file(struct connectdata *conn)
|
||||||
if(conn->resume_from)
|
if(conn->resume_from)
|
||||||
lseek(fd, conn->resume_from, SEEK_SET);
|
lseek(fd, conn->resume_from, SEEK_SET);
|
||||||
|
|
||||||
|
Curl_pgrsTime(data, TIMER_STARTTRANSFER);
|
||||||
|
|
||||||
while (res == CURLE_OK) {
|
while (res == CURLE_OK) {
|
||||||
nread = read(fd, buf, BUFSIZE-1);
|
nread = read(fd, buf, BUFSIZE-1);
|
||||||
|
|
||||||
|
@ -258,8 +261,12 @@ CURLcode Curl_file(struct connectdata *conn)
|
||||||
if(res)
|
if(res)
|
||||||
return res;
|
return res;
|
||||||
|
|
||||||
|
Curl_pgrsSetDownloadCounter(data, (double)bytecount);
|
||||||
|
|
||||||
if(Curl_pgrsUpdate(conn))
|
if(Curl_pgrsUpdate(conn))
|
||||||
res = CURLE_ABORTED_BY_CALLBACK;
|
res = CURLE_ABORTED_BY_CALLBACK;
|
||||||
|
else
|
||||||
|
res = Curl_speedcheck (data, now);
|
||||||
}
|
}
|
||||||
if(Curl_pgrsUpdate(conn))
|
if(Curl_pgrsUpdate(conn))
|
||||||
res = CURLE_ABORTED_BY_CALLBACK;
|
res = CURLE_ABORTED_BY_CALLBACK;
|
||||||
|
|
Loading…
Reference in New Issue