summaryrefslogtreecommitdiff
path: root/networkQuality.go
diff options
context:
space:
mode:
authorWill Hawkins <[email protected]>2023-04-19 09:44:57 -0400
committerWill Hawkins <[email protected]>2023-04-19 09:44:57 -0400
commite2bdd8109e9d707d30d518f4da334ddc2c747eb0 (patch)
tree370d9e575f108ad263e3338c84caf3731143602c /networkQuality.go
parentfd658c8e1ac37a770b62d5d5c53dfaaf9db256a6 (diff)
[Bugfix] Probers starting too soon caused panic
In the case where the scheduler allowed a delay between go threads in a particular order, it was possible that a self prober would attempt to use a connection before an HTTP connection was established. Fixes #45. (at least I hope!)
Diffstat (limited to 'networkQuality.go')
-rw-r--r--networkQuality.go17
1 files changed, 5 insertions, 12 deletions
diff --git a/networkQuality.go b/networkQuality.go
index ef7543d..97f7cb4 100644
--- a/networkQuality.go
+++ b/networkQuality.go
@@ -353,20 +353,13 @@ func main() {
* will create load-generating connections for upload/download
*/
generate_lgd := func() lgc.LoadGeneratingConnection {
- return &lgc.LoadGeneratingConnectionDownload{
- URL: config.Urls.LargeUrl,
- KeyLogger: sslKeyFileConcurrentWriter,
- ConnectToAddr: config.ConnectToAddr,
- InsecureSkipVerify: *insecureSkipVerify,
- }
+ lgd := lgc.NewLoadGeneratingConnectionDownload(config.Urls.LargeUrl, sslKeyFileConcurrentWriter, config.ConnectToAddr, *insecureSkipVerify)
+ return &lgd
}
generate_lgu := func() lgc.LoadGeneratingConnection {
- return &lgc.LoadGeneratingConnectionUpload{
- URL: config.Urls.UploadUrl,
- KeyLogger: sslKeyFileConcurrentWriter,
- ConnectToAddr: config.ConnectToAddr,
- }
+ lgu := lgc.NewLoadGeneratingConnectionUpload(config.Urls.LargeUrl, sslKeyFileConcurrentWriter, config.ConnectToAddr, *insecureSkipVerify)
+ return &lgu
}
generateSelfProbeConfiguration := func() rpm.ProbeConfiguration {
@@ -416,7 +409,7 @@ func main() {
)
// Handles for the first connection that the load-generating go routines (both up and
- // download) open are passed because on the self[Down|Up]ProbeConnectionCommunicationChannel
+ // download) open are passed back on the self[Down|Up]ProbeConnectionCommunicationChannel
// so that we can then start probes on those handles.
selfDownProbeConnection := <-selfDownProbeConnectionCommunicationChannel
selfUpProbeConnection := <-selfUpProbeConnectionCommunicationChannel