mirror of
https://github.com/slackhq/nebula.git
synced 2025-11-09 19:23:57 +01:00
QueryServer needs to be done outside of the lock (#996)
This commit is contained in:
parent
e78fe0b9ef
commit
50d6a1e8ca
@ -318,13 +318,13 @@ func (hm *HandshakeManager) GetOrHandshake(vpnIp iputil.VpnIp, cacheCb func(*Hos
|
|||||||
// StartHandshake will ensure a handshake is currently being attempted for the provided vpn ip
|
// StartHandshake will ensure a handshake is currently being attempted for the provided vpn ip
|
||||||
func (hm *HandshakeManager) StartHandshake(vpnIp iputil.VpnIp, cacheCb func(*HostInfo)) *HostInfo {
|
func (hm *HandshakeManager) StartHandshake(vpnIp iputil.VpnIp, cacheCb func(*HostInfo)) *HostInfo {
|
||||||
hm.Lock()
|
hm.Lock()
|
||||||
defer hm.Unlock()
|
|
||||||
|
|
||||||
if hostinfo, ok := hm.vpnIps[vpnIp]; ok {
|
if hostinfo, ok := hm.vpnIps[vpnIp]; ok {
|
||||||
// We are already trying to handshake with this vpn ip
|
// We are already trying to handshake with this vpn ip
|
||||||
if cacheCb != nil {
|
if cacheCb != nil {
|
||||||
cacheCb(hostinfo)
|
cacheCb(hostinfo)
|
||||||
}
|
}
|
||||||
|
hm.Unlock()
|
||||||
return hostinfo
|
return hostinfo
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -361,6 +361,7 @@ func (hm *HandshakeManager) StartHandshake(vpnIp iputil.VpnIp, cacheCb func(*Hos
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hm.Unlock()
|
||||||
hm.lightHouse.QueryServer(vpnIp, hm.f)
|
hm.lightHouse.QueryServer(vpnIp, hm.f)
|
||||||
return hostinfo
|
return hostinfo
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user