From: phk Date: Thu, 20 Jul 2006 09:42:47 +0000 (+0000) Subject: Loop till we have everything. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0205dca726b9bb3cee7bcbf3cb5fec62d0b92ce9;p=varnish Loop till we have everything. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@514 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_http.c b/varnish-cache/bin/varnishd/cache_http.c index dc1dd829..4cb2ca10 100644 --- a/varnish-cache/bin/varnishd/cache_http.c +++ b/varnish-cache/bin/varnishd/cache_http.c @@ -140,11 +140,12 @@ http_Read(struct http *hp, int fd, void *p, unsigned len) b += u; len -= u; } - if (len > 0) { + while (len > 0) { i = read(fd, b, len); - if (i < 0) + if (i <= 0) return (i); u += i; + len -= u; } return (u); }