lib: More contextification (#6343)

This commit is contained in:
Simon Frei
2020-02-24 21:57:15 +01:00
committed by GitHub
parent 7b8622c2e9
commit f0e33d052a
15 changed files with 138 additions and 42 deletions
+6 -1
View File
@@ -185,7 +185,12 @@ func (s *Service) runStunForServer(ctx context.Context, addr string) {
}
s.client.SetServerAddr(udpAddr.String())
natType, extAddr, err := s.client.Discover()
var natType stun.NATType
var extAddr *stun.Host
err = util.CallWithContext(ctx, func() error {
natType, extAddr, err = s.client.Discover()
return err
})
if err != nil || extAddr == nil {
l.Debugf("%s stun discovery on %s: %s", s, addr, err)
return