swift-nio icon indicating copy to clipboard operation
swift-nio copied to clipboard

Issue-2734 - Clamp buffer to maximum upon large write operation

Open ali-ahsan-ali opened this issue 2 months ago • 1 comments

Fix Issue 2734 by clamping storage size after large write operation

Motivation:

Fix Issue 2734

Modifications:

  • Added a function to clamp storage by copying bytes and setting new capacity of storage
  • Adding a function to clamp the capacity of ByteBuffer
  • Added the ability to specify he maxBufferCapacity to MessageToByteHandler

Result:

Once a write message that is larger than the capacity of the MessageToByteHandler's maxBufferCapacity, it clamps the byteBuffer down.

ali-ahsan-ali avatar Jun 19 '24 10:06 ali-ahsan-ali