From cceecf4b1aba0799ee3d1453b047d73f802b937a Mon Sep 17 00:00:00 2001 From: Arceliar Date: Fri, 22 Jun 2018 23:46:42 -0500 Subject: [PATCH] larger out queue size, make sure linkOut packets always get sent first --- src/yggdrasil/tcp.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/yggdrasil/tcp.go b/src/yggdrasil/tcp.go index 32cfbf3..fcefd42 100644 --- a/src/yggdrasil/tcp.go +++ b/src/yggdrasil/tcp.go @@ -242,7 +242,7 @@ func (iface *tcpInterface) handler(sock net.Conn, incoming bool) { in := func(bs []byte) { 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) go func() { var shadow int64 @@ -296,6 +296,7 @@ func (iface *tcpInterface) handler(sock net.Conn, incoming bool) { select { case msg := <-p.linkOut: send <- msg + continue default: } // Then block until we send or receive something