minor performance adjustments

This commit is contained in:
Arceliar 2018-01-18 18:48:34 -06:00
parent e3d87b8ee6
commit f929df1ea9
3 changed files with 34 additions and 15 deletions

View file

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