rsocket/rsocket-cpp

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

conteit opened this issue · 0 comments

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

  • Modify the channel-hello-world example in order to send the content of a text file (bigger than 15MB) as Payload
  • Run the client against a server with fragmentation set to 15MB.

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

  • RSocket version(s) used: 1.0 (specification), rsocket-cpp commit-id: 1fff6f8
  • Other relevant libraries versions (eg. netty, ...): Spring Boot 2.3.3.RELEASE
  • Platform (eg. JVM version (java -version) or Node version (node --version)): Java 11.0.8
  • OS and version (eg uname -a): Ubuntu 20.04