diff --git a/src/yggdrasil/session.go b/src/yggdrasil/session.go index 517947e..d8b7e9b 100644 --- a/src/yggdrasil/session.go +++ b/src/yggdrasil/session.go @@ -495,7 +495,11 @@ func (sinfo *sessionInfo) recvWorker() { util.PutBytes(bs) } else { // Pass the packet to the buffer for Conn.Read - sinfo.recv <- bs + select { + case <-sinfo.cancel.Finished(): + util.PutBytes(bs) + case sinfo.recv <- bs: + } } } ch <- callback