mirror of https://github.com/ehang-io/nps
maxsize
parent
12ec5d6b26
commit
6c3c09428e
|
@ -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 {
|
||||
|
|
|
@ -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不同,导致读取出的内容存在差异,不利于解密,特此修改
|
||||
|
|
Loading…
Reference in New Issue