summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Hawkins <[email protected]>2021-12-16 20:06:32 -0500
committerWill Hawkins <[email protected]>2021-12-16 20:06:32 -0500
commita85532c22a53d458846f722caa202c7396a3167f (patch)
tree7190fd955f90992ac0505b0c804dd504bcdb3ec6
parent3a87599157a3dd9cb89b4a7c8cba94f7908bcd67 (diff)
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.
-rw-r--r--networkQuality.go11
1 files 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