mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2024-11-24 02:25:21 +00:00
close the connection before blocking a duplicate link
This commit is contained in:
parent
f936151f2d
commit
7b2460662d
@ -107,8 +107,9 @@ func (intf *linkInterface) handler() error {
|
||||
if oldIntf, isIn := intf.link.interfaces[intf.info]; isIn {
|
||||
intf.link.mutex.Unlock()
|
||||
// FIXME we should really return an error and let the caller block instead
|
||||
// That lets them do things like close connections before blocking
|
||||
// That lets them do things like close connections on its own, avoid printing a connection message in the first place, etc.
|
||||
intf.link.core.log.Println("DEBUG: found existing interface for", intf.name)
|
||||
intf.msgIO.close()
|
||||
<-oldIntf.closed
|
||||
return nil
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user