diff options
author | Daniel Stenberg <daniel@haxx.se> | 2004-03-04 15:12:12 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2004-03-04 15:12:12 +0000 |
commit | 2b59e90c549a02670ec790a1d1fabf1e1d09706f (patch) | |
tree | f033c9d5f590a400bdd2acf0f441af76faeea31a | |
parent | 59a30e6d9bb205d593ce0fe5bb585a13869636b2 (diff) |
fix progress data to be updated properly for file: transfers, as reported
by Jesse Noller
-rw-r--r-- | lib/file.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/file.c b/lib/file.c index e10fa8108..e411ac16d 100644 --- a/lib/file.c +++ b/lib/file.c @@ -174,6 +174,7 @@ CURLcode Curl_file(struct connectdata *conn) char *buf = data->state.buffer; curl_off_t bytecount = 0; int fd; + struct timeval now = Curl_tvnow(); /* get the fd from the connection phase */ fd = conn->proto.file->fd; @@ -239,6 +240,8 @@ CURLcode Curl_file(struct connectdata *conn) if(conn->resume_from) lseek(fd, conn->resume_from, SEEK_SET); + Curl_pgrsTime(data, TIMER_STARTTRANSFER); + while (res == CURLE_OK) { nread = read(fd, buf, BUFSIZE-1); @@ -258,8 +261,12 @@ CURLcode Curl_file(struct connectdata *conn) if(res) return res; + Curl_pgrsSetDownloadCounter(data, (double)bytecount); + if(Curl_pgrsUpdate(conn)) res = CURLE_ABORTED_BY_CALLBACK; + else + res = Curl_speedcheck (data, now); } if(Curl_pgrsUpdate(conn)) res = CURLE_ABORTED_BY_CALLBACK; |