Prevent recvBufferSizeLimit from overflowing signed 32-bit integer

This commit is contained in:
Andy Wang 2021-01-09 00:15:46 +00:00
parent f27889af11
commit 32494b8d86
No known key found for this signature in database
GPG Key ID: 181B49F9F38F3374
1 changed files with 1 additions and 1 deletions

View File

@ -25,4 +25,4 @@ type recvBuffer interface {
// size we want the amount of unread data in buffer to grow before recvBuffer.Write blocks.
// If the buffer grows larger than what the system's memory can offer at the time of recvBuffer.Write,
// a panic will happen.
const recvBufferSizeLimit = 1 << 31
const recvBufferSizeLimit = 1<<31 - 1