[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-wget] 1.13.4 patched to support file size limitation
From: |
Giuseppe Scrivano |
Subject: |
Re: [Bug-wget] 1.13.4 patched to support file size limitation |
Date: |
Wed, 28 Mar 2012 10:48:46 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) |
Hello,
Dennis Yurichev <address@hidden> writes:
> diff -rupN wget-1.13.4.original/src/http.c wget-1.13.4-limitsize/src/http.c
> --- wget-1.13.4.original/src/http.c 2011-09-07 13:58:01.000000000 +0300
> +++ wget-1.13.4-limitsize/src/http.c 2012-03-28 01:24:23.114389600 +0300
> @@ -2377,6 +2377,25 @@ read_header:
> }
> }
>
> + if (opt.limit_size && (contlen > opt.limit_size))
> + {
> + logprintf (LOG_VERBOSE, _("%s -- remote file size (%s) "), quote
> (u->path), human_readable(contlen));
> + logprintf (LOG_VERBOSE, _("is bigger than limit-size (%s) option --
> not retrieving.\n"), human_readable(opt.limit_size));
> +
> + /* this piece of code is copypasted from the code below... */
> +
> + /* In case the caller inspects. */
> + hs->len = contlen;
> + hs->res = 0;
> + /* Mark as successfully retrieved. */
> + *dt |= RETROKF;
> + xfree_null (type);
> + CLOSE_INVALIDATE (sock); /* would be CLOSE_FINISH, but there
> + might be more bytes in the body. */
> + xfree (head);
> + return RETRUNNEEDED;
> + }
how does it work when the server doesn't specify the Content-Length? In
this case: contlen == 0.
Cheers,
Giuseppe