rsocket / rsocket-cpp

C++ implementation of RSocket
http://rsocket.io
Apache License 2.0
253 stars 99 forks source link

Not compliant: "A PAYLOAD MUST NOT have both (C)complete and (N)ext empty (false)" #902

Open conteit opened 4 years ago

conteit commented 4 years ago

According to official RSocket specifications: "A PAYLOAD MUST NOT have both (C)complete and (N)ext empty (false)", but rsocket-cpp does not comply with that statement when has to send fragmented frames.

This behavior breaks cross-compatibility with the Java implementation (the one I'm trying to make it work with).

Expected Behavior

Since it is emitting an "item" because its invoked by (ChannelRequester::onNext) I think that at least the (N)ext flag should be set to true.

Actual Behavior

While the client actually fragments the payload correctly with the (F)ollows flag, it sets (C)complete and (N)ext to false.

Steps to Reproduce

Possible Solution

Use the addFlags parameter of rsocket::SreamsWriterImpl::writeFragmented method to pass the right (N)ext and/or (C)omplete flags according to the Subscriber's method that has been invoked.

Your Environment