From a85532c22a53d458846f722caa202c7396a3167f Mon Sep 17 00:00:00 2001 From: Will Hawkins Date: Thu, 16 Dec 2021 20:06:32 -0500 Subject: Bugfix: Make sure that debugging output is properly omitted In the case where the user omitted the -debug flag the client would still output debugging information regardless. This commit fixes that. --- networkQuality.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/networkQuality.go b/networkQuality.go index fb1824e..762ca67 100644 --- a/networkQuality.go +++ b/networkQuality.go @@ -307,8 +307,15 @@ func main() { return &lbc.LoadBearingConnectionUpload{Path: config.Urls.UploadUrl} } - downloadSaturationChannel := saturate(saturationCtx, operatingCtx, generate_lbd, NewDebugging("download")) - uploadSaturationChannel := saturate(saturationCtx, operatingCtx, generate_lbu, NewDebugging("upload")) + var downloadDebugging *Debugging = nil + var uploadDebugging *Debugging = nil + if *debug { + downloadDebugging = &Debugging{Prefix: "download"} + uploadDebugging = &Debugging{Prefix: "upload"} + } + + downloadSaturationChannel := saturate(saturationCtx, operatingCtx, generate_lbd, downloadDebugging) + uploadSaturationChannel := saturate(saturationCtx, operatingCtx, generate_lbu, uploadDebugging) saturationTimeout := false uploadSaturated := false -- cgit v1.2.3