From cf9880464bdf100ea6c88aebd58dc02afef35e07 Mon Sep 17 00:00:00 2001 From: Arceliar Date: Fri, 23 Aug 2019 22:36:59 -0500 Subject: [PATCH] explicitly consider the session finished case, and make a note that we could fix the packet drop situation by making the Conn into an actor too --- src/yggdrasil/session.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/yggdrasil/session.go b/src/yggdrasil/session.go index d17b119f..3f5e913e 100644 --- a/src/yggdrasil/session.go +++ b/src/yggdrasil/session.go @@ -520,8 +520,12 @@ func (sinfo *sessionInfo) _recvPacket(p *wire_trafficPacket) { sinfo.bytesRecvd += uint64(len(bs)) select { case sinfo.toConn <- bs: + case <-sinfo.cancel.Finished(): + util.PutBytes(bs) default: - // We seem to have filled up the buffer in the mean time, so drop it + // We seem to have filled up the buffer in the mean time + // Since we need to not block, but the conn isn't an actor, we need to drop this packet + // TODO find some nicer way to interact with the Conn... util.PutBytes(bs) } }