[4.0] 1eb0a36 Do not log garbage requests.

Lasse Karstensen lkarsten at varnish-software.com
Mon Sep 22 16:38:25 CEST 2014


commit 1eb0a36786e2d653daa14f28af514f516d30514d
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