mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
possibly fix deadlock from race in peer linkloop goroutine, add some related debug code to the admin
This commit is contained in:
parent
63aadf6e88
commit
e9adf327b0
4 changed files with 47 additions and 39 deletions
|
@ -176,13 +176,10 @@ func (iface *tcpInterface) handler(sock *net.TCPConn) {
|
|||
}()
|
||||
p.out = func(msg []byte) {
|
||||
defer func() { recover() }()
|
||||
for {
|
||||
select {
|
||||
case out <- msg:
|
||||
return
|
||||
default:
|
||||
util_putBytes(<-out)
|
||||
}
|
||||
select {
|
||||
case out <- msg:
|
||||
default:
|
||||
util_putBytes(msg)
|
||||
}
|
||||
}
|
||||
sock.SetNoDelay(true)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue