From: hniksic Date: Fri, 12 Dec 2003 22:55:20 +0000 (-0800) Subject: [svn] retr.c (fd_read_body): Pass total size to progress_create, not X-Git-Tag: v1.13~1334 X-Git-Url: http://sjero.net/git/?p=wget;a=commitdiff_plain;h=261183c6092a33a785cc2c6e60447845ce48da12 [svn] retr.c (fd_read_body): Pass total size to progress_create, not the remaining amount. --- diff --git a/src/ChangeLog b/src/ChangeLog index 4de2bc22..9a10ea46 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2003-12-12 Hrvoje Niksic + + * retr.c (fd_read_body): Pass total size to progress_create, not + the remaining amount. + 2003-12-12 Hrvoje Niksic * retr.c (fd_read_body): Don't fiddle with "interactive timeout" diff --git a/src/http.c b/src/http.c index e3889bb0..40a2fceb 100644 --- a/src/http.c +++ b/src/http.c @@ -1718,6 +1718,8 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy) if (keep_alive) flags |= rb_read_exactly; if (hs->restval > 0 && contrange == 0) + /* If the server ignored our range request, instruct fd_read_body + to skip the first RESTVAL bytes of body. */ flags |= rb_skip_startpos; hs->len = hs->restval; hs->rd_size = 0; diff --git a/src/retr.c b/src/retr.c index 6ea558fa..3415ff02 100644 --- a/src/retr.c +++ b/src/retr.c @@ -224,9 +224,10 @@ fd_read_body (int fd, FILE *out, long toread, long startpos, if (opt.verbose) { - /* If we're skipping STARTPOS bytes, hide it from - progress_create because the indicator can't deal with it. */ - progress = progress_create (skip ? 0 : startpos, toread); + /* If we're skipping STARTPOS bytes, pass 0 as the INITIAL + argument to progress_create because the indicator doesn't + (yet) know about "skipping" data. */ + progress = progress_create (skip ? 0 : startpos, startpos + toread); progress_interactive = progress_interactive_p (progress); }