mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2024-11-30 13:35:19 +00:00
make dial fail if a session to the same node already exists, fixes race between simultaneous connections to a node's 200 address and one of its 300 addresses, should also fix races between a search and an accepted listen
This commit is contained in:
parent
730fd08954
commit
8c52ccadf9
@ -204,6 +204,11 @@ func (sinfo *searchInfo) checkDHTRes(res *dhtRes) bool {
|
|||||||
if !isIn {
|
if !isIn {
|
||||||
panic("This should never happen")
|
panic("This should never happen")
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
sinfo.callback(nil, errors.New("session already exists"))
|
||||||
|
// Cleanup
|
||||||
|
delete(sinfo.searches.searches, res.Dest)
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
// FIXME (!) replay attacks could mess with coords? Give it a handle (tstamp)?
|
// FIXME (!) replay attacks could mess with coords? Give it a handle (tstamp)?
|
||||||
sess.coords = res.Coords
|
sess.coords = res.Coords
|
||||||
|
Loading…
Reference in New Issue
Block a user