mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-08 22:31:04 +00:00
Don't deadlock after checking relay client status (fixes #2404)
This commit is contained in:
parent
a32ac62208
commit
f3dc78d457
@ -170,12 +170,13 @@ func (s *Svc) RelayStatus(uri string) (time.Duration, bool) {
|
||||
}
|
||||
|
||||
s.mut.RLock()
|
||||
defer s.mut.RUnlock()
|
||||
|
||||
for _, client := range s.clients {
|
||||
if client.URI().String() == uri {
|
||||
return client.Latency(), client.StatusOK()
|
||||
}
|
||||
}
|
||||
s.mut.RUnlock()
|
||||
|
||||
return time.Hour, false
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user