RUnlock for early exit (#2127)

This commit is contained in:
lifenjoiner 2022-06-14 20:25:52 +08:00 committed by GitHub
parent 6916c047e1
commit 0a0b69d93d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -338,6 +338,7 @@ func findFarthestRoute(proxy *Proxy, name string, relayStamps []stamps.ServerSta
}
}
if serverIdx < 0 {
proxy.serversInfo.RUnlock()
return nil
}
server := proxy.serversInfo.registeredServers[serverIdx]