[master] 930f73d Reduce VSL noise from Debug PROXY_HDR

Nils Goroll nils.goroll at uplex.de
Thu Nov 30 12:22:09 UTC 2017


commit 930f73d6b06e773f90bc4d859771ba974311533a
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Thu Nov 30 13:20:37 2017 +0100

    Reduce VSL noise from Debug PROXY_HDR

diff --git a/bin/varnishd/proxy/cache_proxy_proto.c b/bin/varnishd/proxy/cache_proxy_proto.c
index 1ec3a6b..629a013 100644
--- a/bin/varnishd/proxy/cache_proxy_proto.c
+++ b/bin/varnishd/proxy/cache_proxy_proto.c
@@ -467,6 +467,11 @@ VPX_Send_Proxy(int fd, int version, const struct sess *sp)
 
 	AZ(VSB_finish(vsb));
 	(void)write(fd, VSB_data(vsb), VSB_len(vsb));
+	if (! DO_DEBUG(DBG_PROTOCOL)) {
+		VSB_delete(vsb);
+		return;
+	}
+
 	vsb2 = VSB_new_auto();
 	AN(vsb2);
 	VSB_quote(vsb2, VSB_data(vsb), VSB_len(vsb),
diff --git a/include/tbl/debug_bits.h b/include/tbl/debug_bits.h
index 3579a5d..4ac3ef6 100644
--- a/include/tbl/debug_bits.h
+++ b/include/tbl/debug_bits.h
@@ -49,6 +49,7 @@ DEBUG_BIT(SLOW_ACCEPTOR,	slow_acceptor,	"Slow down Acceptor")
 DEBUG_BIT(H2_NOCHECK,		h2_nocheck,	"Disable various H2 checks")
 DEBUG_BIT(VMOD_SO_KEEP,		vmod_so_keep,	"Keep copied VMOD libraries")
 DEBUG_BIT(PROCESSORS,		processors,	"Fetch/Deliver processors")
+DEBUG_BIT(PROTOCOL,		protocol,	"Protocol debugging")
 #undef DEBUG_BIT
 
 /*lint -restore */


More information about the varnish-commit mailing list