r3205 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Fri Sep 19 22:47:32 CEST 2008


Author: phk
Date: 2008-09-19 22:47:32 +0200 (Fri, 19 Sep 2008)
New Revision: 3205

Modified:
   trunk/varnish-cache/bin/varnishd/cache_http.c
Log:
Strip trailing whitespace on header lines from the stored result.



Modified: trunk/varnish-cache/bin/varnishd/cache_http.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_http.c	2008-09-19 20:20:10 UTC (rev 3204)
+++ trunk/varnish-cache/bin/varnishd/cache_http.c	2008-09-19 20:47:32 UTC (rev 3205)
@@ -379,7 +379,6 @@
 		r = q + 1;
 		if (q > p && q[-1] == '\r')
 			q--;
-		*q = '\0';
 		if (p == q)
 			break;
 
@@ -388,6 +387,10 @@
 		    p[2] == '-')
 			hp->conds = 1;
 
+		while (q > p && vct_issp(q[-1]))
+			q--;
+		*q = '\0';
+
 		if (hp->nhd < HTTP_HDR_MAX) {
 			hp->hdf[hp->nhd] = 0;
 			hp->hd[hp->nhd].b = p;




More information about the varnish-commit mailing list