]> sjero.net Git - wget/commitdiff
[svn] retr.c (fd_read_body): Pass total size to progress_create, not
authorhniksic <devnull@localhost>
Fri, 12 Dec 2003 22:55:20 +0000 (14:55 -0800)
committerhniksic <devnull@localhost>
Fri, 12 Dec 2003 22:55:20 +0000 (14:55 -0800)
the remaining amount.

src/ChangeLog
src/http.c
src/retr.c

index 4de2bc220e94f56fa27896c3a7e0c6af0dd9a1cb..9a10ea467c39a472718cb62bb2e2dd3787ca0b6a 100644 (file)
@@ -1,3 +1,8 @@
+2003-12-12  Hrvoje Niksic  <hniksic@xemacs.org>
+
+       * retr.c (fd_read_body): Pass total size to progress_create, not
+       the remaining amount.
+
 2003-12-12  Hrvoje Niksic  <hniksic@xemacs.org>
 
        * retr.c (fd_read_body): Don't fiddle with "interactive timeout"
index e3889bb017a45904a74618780f4d5cce0a5a1f96..40a2fcebe5238d9995560843f8669cf7fffad58a 100644 (file)
@@ -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;
index 6ea558fa49a36eb79e01695a114777df4c46169c..3415ff02d5feb3c3accf2996fc64c25fd389cdef 100644 (file)
@@ -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);
     }