Small modification in wslay_frame_recv of wslay_frame.c regarding fin bit and opcode#7
Open
nikita-n wants to merge 2 commits intotatsuhiro-t:masterfrom
Open
Small modification in wslay_frame_recv of wslay_frame.c regarding fin bit and opcode#7nikita-n wants to merge 2 commits intotatsuhiro-t:masterfrom
nikita-n wants to merge 2 commits intotatsuhiro-t:masterfrom
Conversation
added 2 commits
October 10, 2013 11:10
Expected behavior: 'Ref RFC 6455' A fragmented message consists of a single frame with the FIN bit clear and an opcode other than 0, followed by zero or more frames with the FIN bit clear and the opcode set to 0, and terminated by a single frame with the FIN bit set and an opcode of 0 Current Behavior: When server sends data in fragmented frames, for some platforms, the data received is not always equal to the payload length and hence the original frame is received in multiple receives due to which the final bit is set even if the received fragmented subframe is not the terminating one. Consider if server sends the terminating frame of size 1008 bytes with final bit set. On client side, it further gets divided into two chunks of size 532 bytes and 476 bytes. For both the frames the final bit is set which violates the protocol. This behavior is observed as the final bit value received from server is directly assigned to the client side frame without checking if thats the terminating frame or not.
Expected behavior:
'Ref RFC 6455'
A fragmented message consists of a single frame with the FIN bit
clear and an opcode other than 0, followed by zero or more frames
with the FIN bit clear and the opcode set to 0, and terminated by
a single frame with the FIN bit set and an opcode of 0
Current Behavior:
When server sends data in fragmented frames,
for some platforms, the data received is not always equal to the payload
length and hence the original frame is received in multiple receives due to
which the opcode bit is set even if the received fragmented subframe is not
the first one.
Consider if server sends the first frame of size 1008 bytes with opcode bit set.
On client side, it further gets divided into two chunks of size 532 bytes
and 476 bytes. For both the frames the opcode is set which violates the
protocol.
This behavior is observed as the opcode bit value received from server is
directly assigned to the client side frame without checking if thats the
first frame or not.
Signed-off-by: Nikita Nerkar <nikitan@marvell.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.
No description provided.