[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: Re: [BusyBox] [Patch] wget: do not get stuck by trying to read too
From: Glenn McGrath <bug1 () optushome ! com ! au>
Date: 2003-08-29 6:28:20
[Download RAW message or body]
On Thu, 28 Aug 2003 17:09:37 -0700
Junio C Hamano <junkio@cox.net> wrote:
> I may be mistaken but aren't you breaking chunked case here?
>
> Maybe you can re-rewrite as follows if you find it more
> readable:
>
> (chunked || got_clen) && (filesize < sizeof(buf))
> ? filesize
> : sizeof(buf)
>
> In human terms: if chunked or clen is known, then we can use
> filesize to determine how much to read, so see if filesize is
> smaller than sizeof(buf) and use filesize in that case. All
> others keep using sizeof(buf) and have fread() time out.
Yes, i see my logic was wrong, its now changed to as you suggest.
Its not just for readability, avoiding nested if statements also reduces
binary size.
Thanks
Glenn
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic