mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-11-29 21:21:35 +00:00
larger out queue size, make sure linkOut packets always get sent first
This commit is contained in:
parent
0021f3463f
commit
cceecf4b1a
@ -242,7 +242,7 @@ func (iface *tcpInterface) handler(sock net.Conn, incoming bool) {
|
|||||||
in := func(bs []byte) {
|
in := func(bs []byte) {
|
||||||
p.handlePacket(bs)
|
p.handlePacket(bs)
|
||||||
}
|
}
|
||||||
out := make(chan []byte, 1)
|
out := make(chan []byte, 1024) // Should be effectively infinite, but gets fed into finite LIFO stack
|
||||||
defer close(out)
|
defer close(out)
|
||||||
go func() {
|
go func() {
|
||||||
var shadow int64
|
var shadow int64
|
||||||
@ -296,6 +296,7 @@ func (iface *tcpInterface) handler(sock net.Conn, incoming bool) {
|
|||||||
select {
|
select {
|
||||||
case msg := <-p.linkOut:
|
case msg := <-p.linkOut:
|
||||||
send <- msg
|
send <- msg
|
||||||
|
continue
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
// Then block until we send or receive something
|
// Then block until we send or receive something
|
||||||
|
Loading…
Reference in New Issue
Block a user