[svn] retr.c (fd_read_body): Pass total size to progress_create, not

the remaining amount.
This commit is contained in:
hniksic 2003-12-12 14:55:20 -08:00
parent 9179f2e699
commit 261183c609
3 changed files with 11 additions and 3 deletions

View 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"

View 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;

View 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);
}