fix(stunreachability): avoid goroutine spin and memleak (#255)
This fix addresses the bug described in issue https://github.com/ooni/probe/issues/1403.
This commit is contained in:
parent
a02052fb0c
commit
c324822870
|
@ -122,15 +122,15 @@ func (tk *TestKeys) do(
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer conn.Close()
|
||||
newClient := stun.NewClient
|
||||
if config.newClient != nil {
|
||||
newClient = config.newClient
|
||||
}
|
||||
client, err := newClient(conn, stun.WithNoConnClose)
|
||||
client, err := newClient(conn)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer client.Close()
|
||||
message := stun.MustBuild(stun.TransactionID, stun.BindingRequest)
|
||||
ch := make(chan error)
|
||||
err = client.Start(message, func(ev stun.Event) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user