r571 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Mon Jul 31 09:13:45 CEST 2006


Author: phk
Date: 2006-07-31 09:13:45 +0200 (Mon, 31 Jul 2006)
New Revision: 571

Modified:
   trunk/varnish-cache/bin/varnishd/cache_http.c
Log:
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.



Modified: trunk/varnish-cache/bin/varnishd/cache_http.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_http.c	2006-07-31 06:36:56 UTC (rev 570)
+++ trunk/varnish-cache/bin/varnishd/cache_http.c	2006-07-31 07:13:45 UTC (rev 571)
@@ -409,7 +409,11 @@
 
 	(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);




More information about the varnish-commit mailing list