mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-03-09 15:40:15 +00:00
make sure the sessionInfo.recvWorker doesn't block if sinfo.recv somehow fills
This commit is contained in:
parent
71e9ca25f7
commit
9ab08446ff
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue