summaryrefslogtreecommitdiff
path: root/networkQuality.go
diff options
context:
space:
mode:
authorWill Hawkins <[email protected]>2021-12-28 05:50:37 +0000
committerWill Hawkins <[email protected]>2021-12-28 05:50:37 +0000
commit0aa0ba75a8f17a09d3e7541cfe8c78e139299cc5 (patch)
treedb8675983d3655d4bedb72cc07fca332215f3164 /networkQuality.go
parentc6574f4232efe259f225d443df5db442fa240052 (diff)
Bugfix: Create new transports for each HTTP connection
By default go's network stack "helpfully" reuses the Transports among http.Clients. This will artifically inhibit the full use of the network. Creating new Transports for every http.Client will keep this from happening.
Diffstat (limited to 'networkQuality.go')
-rw-r--r--networkQuality.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/networkQuality.go b/networkQuality.go
index 5efbc8a..9b632e5 100644
--- a/networkQuality.go
+++ b/networkQuality.go
@@ -388,6 +388,9 @@ func main() {
rttTimeout := false
for i := 0; i < robustnessProbeIterationCount && !rttTimeout; i++ {
+ if len(downloadSaturation.Lbcs) == 0 {
+ continue
+ }
randomLbcsIndex := rand.New(rand.NewSource(int64(time.Now().Nanosecond()))).Int() % len(downloadSaturation.Lbcs)
if !downloadSaturation.Lbcs[randomLbcsIndex].IsValid() {
if debug != nil {