Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pkg/protocol/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ func (h *BaseHandler) ReceiveLoop() {
// records back to back, or a whole record plus the head of the next one.
// The accumulator below therefore lives OUTSIDE the read loop so that a
// record straddling two Read calls is reassembled rather than discarded.
buffer := make([]byte, 16*1024*1024)
// The read size only bounds how many iterations a large payload takes, never
// how it is framed, so it costs nothing to keep it small.
buffer := make([]byte, 64*1024)
acc := make([]byte, 0, HeaderSize+MaxPacketDataSize)

for {
Expand Down