[master] 39f6f36 Do not log garbage requests.

Lasse Karstensen lkarsten at varnish-software.com
Tue Sep 2 12:42:07 CEST 2014


commit 39f6f3622fd4b880c4149c576b44ce4ed475d6ba
Author: Lasse Karstensen <lkarsten at varnish-software.com>
Date:   Tue Sep 2 12:33:16 2014 +0200

    Do not log garbage requests.
    
    Requests that end up in the hard "400 Bad Request" handling used to be
    logged with incomplete data. (no method, maybe no path, possibly no proto,
    and no response status)
    
    Port scans or anything sending a byte and a linefeed would be logged.
    
    Since this is used for logging access to a web site, it makes more sense
    to skip these garbage requests.
    
    Fixes:		#1584

diff --git a/bin/varnishncsa/varnishncsa.c b/bin/varnishncsa/varnishncsa.c
index 59c1918..a6658e3 100644
--- a/bin/varnishncsa/varnishncsa.c
+++ b/bin/varnishncsa/varnishncsa.c
@@ -760,6 +760,9 @@ dispatch_f(struct VSL_data *vsl, struct VSL_transaction * const pt[],
 				e--;
 
 			switch (tag) {
+			case SLT_HttpGarbage:
+				skip = 1;
+				break;
 			case SLT_PipeAcct:
 				frag_fields(b, e,
 				    3, &CTX.frag[F_I],



More information about the varnish-commit mailing list