mirror of
https://github.com/yggdrasil-network/yggdrasil-go
synced 2024-11-10 07:20:39 +03:00
Merge pull request #502 from Arceliar/linkleak
Try to fix leaks in #501
This commit is contained in:
commit
d9fabad8bc
@ -179,7 +179,10 @@ func (intf *linkInterface) handler() error {
|
|||||||
// That lets them do things like close connections on its own, avoid printing a connection message in the first place, etc.
|
// 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.Debugln("DEBUG: found existing interface for", intf.name)
|
intf.link.core.log.Debugln("DEBUG: found existing interface for", intf.name)
|
||||||
intf.msgIO.close()
|
intf.msgIO.close()
|
||||||
<-oldIntf.closed
|
if !intf.incoming {
|
||||||
|
// Block outgoing connection attempts until the existing connection closes
|
||||||
|
<-oldIntf.closed
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
} else {
|
} else {
|
||||||
intf.closed = make(chan struct{})
|
intf.closed = make(chan struct{})
|
||||||
|
Loading…
Reference in New Issue
Block a user