mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2025-07-30 22:23:44 +00:00
make sure the sessionInfo.recvWorker doesn't block if sinfo.recv somehow fills
This commit is contained in:
@@ -495,7 +495,11 @@ func (sinfo *sessionInfo) recvWorker() {
|
|||||||
util.PutBytes(bs)
|
util.PutBytes(bs)
|
||||||
} else {
|
} else {
|
||||||
// Pass the packet to the buffer for Conn.Read
|
// 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
|
ch <- callback
|
||||||
|
Reference in New Issue
Block a user