]> err.no Git - varnish/commitdiff
Loop till we have everything.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 20 Jul 2006 09:42:47 +0000 (09:42 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 20 Jul 2006 09:42:47 +0000 (09:42 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@514 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_http.c

index dc1dd829d039a0055104960f03aa706ee3d0a623..4cb2ca103c332fc27db4cd47ac1d283981dbe7a7 100644 (file)
@@ -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);
 }