mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
minor performance adjustments
This commit is contained in:
parent
e3d87b8ee6
commit
f929df1ea9
3 changed files with 34 additions and 15 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue