From bca69df1f6da415c97d15c5b18a770b404ffa190 Mon Sep 17 00:00:00 2001 From: Arceliar Date: Sat, 26 Jan 2019 14:07:18 -0600 Subject: [PATCH] possible workaround to a deadlock --- src/yggdrasil/session.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/yggdrasil/session.go b/src/yggdrasil/session.go index 6b7f62d2..cdabaf2b 100644 --- a/src/yggdrasil/session.go +++ b/src/yggdrasil/session.go @@ -625,5 +625,8 @@ func (sinfo *sessionInfo) doRecv(p *wire_trafficPacket) { sinfo.updateNonce(&p.Nonce) sinfo.time = time.Now() sinfo.bytesRecvd += uint64(len(bs)) - sinfo.core.router.toRecv <- router_recvPacket{bs, sinfo} + select { + case sinfo.core.router.toRecv <- router_recvPacket{bs, sinfo}: + default: // avoid deadlocks, maybe do this somewhere else?... + } }