mirror of
https://github.com/ehang-io/nps.git
synced 2025-09-01 02:46:52 +00:00
maxsize
This commit is contained in:
@@ -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不同,导致读取出的内容存在差异,不利于解密,特此修改
|
||||
|
Reference in New Issue
Block a user