make sure the sessionInfo.recvWorker doesn't block if sinfo.recv somehow fills

This commit is contained in:
Arceliar 2019-08-07 17:40:50 -05:00
parent 71e9ca25f7
commit 9ab08446ff

View File

@ -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