swift-nio
swift-nio copied to clipboard
Issue-2734 - Clamp buffer to maximum upon large write operation
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.