From: phk Date: Mon, 31 Jul 2006 07:13:45 +0000 (+0000) Subject: Don't fill more than half the workspace with received data, we need to X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a76e86617f1324c6f4c4155e829e8af694c75f2c;p=varnish Don't fill more than half the workspace with received data, we need to 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 --- diff --git a/varnish-cache/bin/varnishd/cache_http.c b/varnish-cache/bin/varnishd/cache_http.c index d9de2329..e1beeca0 100644 --- a/varnish-cache/bin/varnishd/cache_http.c +++ b/varnish-cache/bin/varnishd/cache_http.c @@ -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);