mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-30 01:52:26 +08:00
dht/notif: bugfix in hanging connects
http://gifs.gifbin.com/012011/1295375531_cat-jump-fail.gif
This commit is contained in:
@ -18,6 +18,7 @@ func (nn *netNotifiee) Connected(n inet.Network, v inet.Conn) {
|
|||||||
select {
|
select {
|
||||||
case <-dht.Closing():
|
case <-dht.Closing():
|
||||||
return
|
return
|
||||||
|
default:
|
||||||
}
|
}
|
||||||
dht.Update(dht.Context(), v.RemotePeer())
|
dht.Update(dht.Context(), v.RemotePeer())
|
||||||
}
|
}
|
||||||
@ -27,6 +28,7 @@ func (nn *netNotifiee) Disconnected(n inet.Network, v inet.Conn) {
|
|||||||
select {
|
select {
|
||||||
case <-dht.Closing():
|
case <-dht.Closing():
|
||||||
return
|
return
|
||||||
|
default:
|
||||||
}
|
}
|
||||||
dht.routingTable.Remove(v.RemotePeer())
|
dht.routingTable.Remove(v.RemotePeer())
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user