fix Constructor doesn't store fragmentation#307
Open
Niteesh wants to merge 1 commit intorsocket:1.0.x-alphafrom
Open
fix Constructor doesn't store fragmentation#307Niteesh wants to merge 1 commit intorsocket:1.0.x-alphafrom
Niteesh wants to merge 1 commit intorsocket:1.0.x-alphafrom
Conversation
… streams rsocket#306 Signed-off-by: Niteesh Kumar <niteesh3@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
RSocketServer accepts a fragmentation.maxOutboundFragmentSize config, but it only applies to
the requester side (server-initiated requests). The responder side (server responses to client
requests) always uses fragmentSize=0, meaning responses are never fragmented.
This causes a crash when the server tries to send a response larger than 16MB (the RSocket frame
length field is 24-bit, max 16,777,215 bytes), because writeUInt24BE overflows:
RangeError: The value of "value" is out of range. It must be >= 0 and <= 255.
at writeUInt24BE (rsocket-core/src/Codecs.ts:80)
at serializeFrameWithLength (rsocket-core/src/Codecs.ts:161)
Root Cause
Two issues in packages/rsocket-core/src/RSocketServer.ts:
Constructor doesn't store fragmentation: The fragmentation field from ServerConfig is
never assigned to this, so this.fragmentation is always undefined.
DefaultStreamRequestHandler hardcodes fragmentSize=0: Even if this.fragmentation were
stored, the stream handler is created with fragmentSize=0 instead of using the configured value.
Signed-off-by: Niteesh niteesh3@gmail.com