mirror of https://github.com/qwqdanchun/nps.git
fix window write loss
This commit is contained in:
parent
f0201c1039
commit
847f0ce1d4
|
@ -223,10 +223,10 @@ func (Self *window) SetSendBuf(buf []byte) {
|
||||||
func (Self *window) fullSlide() {
|
func (Self *window) fullSlide() {
|
||||||
// slide by allocate
|
// slide by allocate
|
||||||
newBuf := common.WindowBuff.Get()
|
newBuf := common.WindowBuff.Get()
|
||||||
copy(newBuf[0:Self.len()], Self.windowBuff[Self.off:])
|
Self.liteSlide()
|
||||||
Self.off = 0
|
n := copy(newBuf[:Self.len()], Self.windowBuff)
|
||||||
common.WindowBuff.Put(Self.windowBuff)
|
common.WindowBuff.Put(Self.windowBuff)
|
||||||
Self.windowBuff = newBuf
|
Self.windowBuff = newBuf[:n]
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue