]> err.no Git - varnish/commitdiff
Don't fill more than half the workspace with received data, we need to
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 31 Jul 2006 07:13:45 +0000 (07:13 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 31 Jul 2006 07:13:45 +0000 (07:13 +0000)
have space for composing the reply as well.

Without this fix, the entire workspace could be filled with pipelined
requests and we would have no space to compose the reply.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@571 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_http.c

index d9de232993181263384c56aebabe5d6038a9ec5f..e1beeca05b9aeb3d05503cd7d7723ee4f534ed0c 100644 (file)
@@ -409,7 +409,11 @@ http_read_f(int fd, short event, void *arg)
 
        (void)event;
 
-       l = hp->e - hp->v;
+       l = (hp->e - hp->s) / 2;
+       if (l < hp->v - hp->s)
+               l = 0;
+       else
+               l -= hp->v - hp->s;
        if (l <= 1) {
                VSL(SLT_HttpError, fd, "Received too much");
                VSLR(SLT_HttpGarbage, fd, hp->s, hp->v);