mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-11-13 00:30:28 +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 {
|
if oldIntf, isIn := intf.link.interfaces[intf.info]; isIn {
|
||||||
intf.link.mutex.Unlock()
|
intf.link.mutex.Unlock()
|
||||||
// FIXME we should really return an error and let the caller block instead
|
// 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.link.core.log.Println("DEBUG: found existing interface for", intf.name)
|
||||||
|
intf.msgIO.close()
|
||||||
<-oldIntf.closed
|
<-oldIntf.closed
|
||||||
return nil
|
return nil
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user