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 1 year 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

Addressing https://github.com/apple/swift-nio/issues/2734

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

Hey @weissi LMK when you find time to take a look at this. No rush!

ali-ahsan-ali avatar Sep 10 '24 08:09 ali-ahsan-ali

Hey @weissi LMK when you find time to take a look at this. No rush!

Commented, looks 99% complete, just three small things

weissi avatar Sep 10 '24 09:09 weissi

Will cry tears of joy once this gets merged 👍

ali-ahsan-ali avatar Sep 14 '24 10:09 ali-ahsan-ali