]> err.no Git - varnish/commitdiff
Loop until we have read it all
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Wed, 19 Apr 2006 06:38:57 +0000 (06:38 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Wed, 19 Apr 2006 06:38:57 +0000 (06:38 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@143 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_fetch.c

index 44afd29afe4fa05750a3394839373157eaeb7b67..8c8a43860cfa8768a85eea82694310df2ef10d58 100644 (file)
@@ -91,10 +91,13 @@ FetchSession(struct worker *w, struct sess *sp)
                p += i;
                cl -= i;
        }
-       if (cl != 0) {
+
+       while (cl != 0) {
                i = read(sp2.fd, p, cl);
+               assert(i > 0);
                VSL(SLT_Debug, 0, "R i %d cl %jd", i, cl);
-               assert(i == cl);
+               p += i;
+               cl -= i;
        }
 
        HttpdBuildSbuf(1, 1, w->sb, &sp2);