pull/1219/head
刘河 2019-01-10 11:38:29 +08:00
parent 12ec5d6b26
commit 6c3c09428e
2 changed files with 2 additions and 2 deletions

View File

@ -113,7 +113,7 @@ func (s *SnappyConn) Read(b []byte) (n int, err error) {
n = 0
}
}()
if n, err = s.r.Read(b); err != nil {
if n, err = s.r.Read(b); err != nil || err == io.EOF {
return
}
if s.crypt {

View File

@ -153,7 +153,7 @@ func GetIntNoerrByStr(str string) int {
var bufPool = sync.Pool{
New: func() interface{} {
return make([]byte, 65535)
return make([]byte, 65536)
},
}
// io.copy的优化版读取buffer长度原为32*1024与snappy不同导致读取出的内容存在差异不利于解密特此修改