Infer pp.Decoder.MaxLength from chunk size (#743)

This commit is contained in:
Alex Sharov 2022-05-08 08:36:43 +07:00 committed by GitHub
parent 1f6b23d995
commit 3a3307632a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1117,7 +1117,7 @@ func (c *PeerConn) mainReadLoop() (err error) {
decoder := pp.Decoder{
R: bufio.NewReaderSize(c.r, 1<<17),
MaxLength: 256 * 1024,
MaxLength: 4 * pp.Integer(max(int64(t.chunkSize), defaultChunkSize)),
Pool: &t.chunkPool,
}
for {