From 847f0ce1d495b642b531f61816c54b2c1bbded6a Mon Sep 17 00:00:00 2001 From: ffdfgdfg Date: Mon, 23 Sep 2019 23:09:58 +0800 Subject: [PATCH] fix window write loss --- lib/mux/conn.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/mux/conn.go b/lib/mux/conn.go index b1141ee..3f824cc 100644 --- a/lib/mux/conn.go +++ b/lib/mux/conn.go @@ -223,10 +223,10 @@ func (Self *window) SetSendBuf(buf []byte) { func (Self *window) fullSlide() { // slide by allocate newBuf := common.WindowBuff.Get() - copy(newBuf[0:Self.len()], Self.windowBuff[Self.off:]) - Self.off = 0 + Self.liteSlide() + n := copy(newBuf[:Self.len()], Self.windowBuff) common.WindowBuff.Put(Self.windowBuff) - Self.windowBuff = newBuf + Self.windowBuff = newBuf[:n] return }