possibly fix deadlock from race in peer linkloop goroutine, add some related debug code to the admin

This commit is contained in:
Arceliar 2018-02-07 17:48:30 -06:00
parent 63aadf6e88
commit e9adf327b0
4 changed files with 47 additions and 39 deletions

View file

@ -224,13 +224,10 @@ func (iface *udpInterface) handleKeys(msg []byte, addr connAddr) {
}
conn.peer.out = func(msg []byte) {
defer func() { recover() }()
for {
select {
case conn.out <- msg:
return
default:
util_putBytes(<-conn.out)
}
select {
case conn.out <- msg:
default:
util_putBytes(msg)
}
}
go func() {