[master] c0e2acc When headers are surplus to limits, only log the first 20 char.

Poul-Henning Kamp phk at varnish-cache.org
Wed Aug 31 17:27:55 CEST 2011


commit c0e2accfb3ce6bc46696ad22ad78b886d064be96
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Aug 31 15:27:41 2011 +0000

    When headers are surplus to limits, only log the first 20 char.

diff --git a/bin/varnishd/cache_http.c b/bin/varnishd/cache_http.c
index 7fe0a8a..f77ab74 100644
--- a/bin/varnishd/cache_http.c
+++ b/bin/varnishd/cache_http.c
@@ -522,7 +522,8 @@ http_dissect_hdrs(struct worker *w, struct http *hp, int fd, char *p,
 
 		if (q - p > htc->maxhdr) {
 			VSC_C_main->losthdr++;
-			WSL(w, SLT_LostHeader, fd, "%.*s", q - p, p);
+			WSL(w, SLT_LostHeader, fd, "%.*s",
+			    q - p > 20 ? 20 : q - p, p);
 			return (413);
 		}
 
@@ -547,7 +548,8 @@ http_dissect_hdrs(struct worker *w, struct http *hp, int fd, char *p,
 			hp->nhd++;
 		} else {
 			VSC_C_main->losthdr++;
-			WSL(w, SLT_LostHeader, fd, "%.*s", q - p, p);
+			WSL(w, SLT_LostHeader, fd, "%.*s",
+			    q - p > 20 ? 20 : q - p, p);
 			return (413);
 		}
 	}



More information about the varnish-commit mailing list