r5708 - trunk/varnish-cache/bin/varnishd

phk at varnish-cache.org phk at varnish-cache.org
Tue Jan 11 10:18:20 CET 2011


Author: phk
Date: 2011-01-11 10:18:20 +0100 (Tue, 11 Jan 2011)
New Revision: 5708

Modified:
   trunk/varnish-cache/bin/varnishd/cache_center.c
Log:
Make sure we have space to align the Content-Length header we create.



Modified: trunk/varnish-cache/bin/varnishd/cache_center.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_center.c	2011-01-10 14:45:00 UTC (rev 5707)
+++ trunk/varnish-cache/bin/varnishd/cache_center.c	2011-01-11 09:18:20 UTC (rev 5708)
@@ -591,8 +591,11 @@
 	if (vary != NULL)
 		l += varyl;
 
-	/* Space for producing a Content-Length: header */
-	l += 30;
+	/*
+	 * Space for producing a Content-Length: header including padding 
+	 * A billion gigabytes is enough for anybody.
+	 */
+	l += strlen("Content-Encoding: XxxXxxXxxXxxXxxXxx" + sizeof(void *));
 
 	/*
 	 * XXX: If we have a Length: header, we should allocate the body




More information about the varnish-commit mailing list