bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-wget] [Patch] Regression: write error on wget -c for already fu


From: Ángel González
Subject: Re: [Bug-wget] [Patch] Regression: write error on wget -c for already fully retrieved file
Date: Wed, 14 Nov 2012 00:37:51 +0100
User-agent: Thunderbird

On 13/11/12 23:59, Giuseppe Scrivano wrote:
> Thanks for the report.  The code you have reverted seems correct to me.
>
> I think the proper patch should be this:
>
> diff --git a/src/retr.c b/src/retr.c
> index 6204839..5bbae80 100644
> --- a/src/retr.c
> +++ b/src/retr.c
> @@ -376,7 +376,7 @@ fd_read_body (int fd, FILE *out, wgint toread, wgint 
> startpos,
>          {
>            sum_read += ret;
>            int write_res = write_data (out, out2, dlbuf, ret, &skip, 
> &sum_written);
> -          if (write_res != 0)
> +          if (write_res < 0)
>              {
>                ret = (write_res == -3) ? -3 : -2;
>                goto out;
>
>
> It works here for me, can you confirm it?
>
> Cheers,
> Giuseppe
It's funny, I fixed the same problem in a different way just 3 days ago
(cf «'All buffer
skipped' in write_data» thread), but I did that in write_data instead of
fd_read_body or
read_header.

Your change is equivalent to mine, but as you are defining 1 as a good
return code, you
should change the «In case of any other error, 1 is returned.» text in
the comment.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]