-
Notifications
You must be signed in to change notification settings - Fork 720
Description
See #3411 (comment) for the origin of this issue.
Expected behavior
The behavior described below should not happen.
Actual behavior
It [ByteToMessageDecoderVerifier.verifyDecoder] fails with "under production" error when it calls
channel.readInbound(as:)and that returnsnil, but it should callchannel.finish()at that point so it gets the last result and everything matches up.
The split-decoder needs to have been called withdecodeLast(sochannel.finish()), if it's going to return whatever is left in the buffer, when the buffer doesn't contain any separators anymore. If it's called with justdecode, it'll returnnilto request more data, which is correct behavior.
Steps to reproduce
See the commit in that PR, which I reverted.
mahdibm/swift-nio, tag byte2msgverifier-fails-too-early.
There is a [0...0] in there which was just for my testing. The tests fail anyway even with that so doesn't really matter.
If possible, minimal yet complete reproducer code (or URL to code)
See above.
SwiftNIO version/commit hash
Building on top of commit 767ea9ee09c4227d32f230c7e24bb9f5a6a5cfd9. So after 2.87.0.
System & version information
Doesn't matter.