mirror of
https://github.com/xtaci/kcp-go.git
synced 2024-04-21 12:32:15 +00:00
return FEC segments to xmitBuf when session closes
This commit is contained in:
@@ -209,6 +209,13 @@ func (dec *fecDecoder) freeRange(first, n int, q []fecElement) []fecElement {
|
||||
return q[:len(q)-n]
|
||||
}
|
||||
|
||||
// release all segments back to xmitBuf
|
||||
func (dec *fecDecoder) release() {
|
||||
if n := len(dec.rx); n > 0 {
|
||||
dec.rx = dec.freeRange(0, n, dec.rx)
|
||||
}
|
||||
}
|
||||
|
||||
type (
|
||||
// fecEncoder for encoding outgoing packets
|
||||
fecEncoder struct {
|
||||
|
||||
Reference in New Issue
Block a user