mirror of
https://github.com/apple/swift-nio-extras
synced 2026-11-25 04:47:50 +00:00
### Motivation: `LineBasedFrameDecoder.decodeLast` throws an error if there is more than one frame’s worth of bytes remaining in the buffer. This is in violation of the `NIOSingleStepByteToMessageDecoder`protocol requirement that this method be called in a loop until all bytes are decoded. ### Modifications: * The method now only throws if the decode operation could not return a frame and there are bytes left in the buffer (previously only the latter criterion applied). * Method documentation is updated. * Test added. ### Result: `LineBasedFrameDecoder.decodeLast` can cope with more edge cases. Co-authored-by: Rick Newton-Rogers <rnro@apple.com>