Fix a bug in chunked fetching:
With very short chunks, in this case 3 characters, our buffer may
contain not only the chunk length and the chunk data, but also the
next chunk length.
If the short chunk is the last chunk before the zero length chunk
at the end, unconditionally trying to fill the buffer before parsing
the length may hang because we already have everything there is to
have in the buffer.
The fix is to always try to parse the buffer before adding to it.
While here, tighten up and improve error checks of the code.
Reported by: Xing Li <xing@litespeedtech.com>
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@917
d4fa192b-c00b-0410-8231-
f00ffab90ce4