-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
- Loading branch information
There are no files selected for viewing
8 comments
on commit 6b3904b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why but this commit introduced an utf-8 validation error when running bench/speed.js
. We need to investigate why this is happening.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't reproduce that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird, I can reproduce it with 100% accuracy on macOS by only enabling this config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that the issue happens because data is changed in place, so the next time send
is called, the mask is applied on an already masked buffer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, canModifyData
is incorrect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a fix for this, maybe revisit it later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Nibbler999 there might be another issue with this.
Imagine a fragmented message with only 2 fragments and permessage-deflate enabled. The first fragment is above the threshold so it will be compressed. The second one is below the threshold and will not be compressed.
The receiving end will try to decompress both fragments causing data corruption or an error to be raised.
We should at least document this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. This should be addressed by d3fef3b
@Nibbler999 I spotted an issue with this while running the Autobahn test suite.
If
data
is a buffer, a new buffer is created after converting it to a utf8 string changing the original buffer contents.I think a clean way to fix this would be to extract the data handling
if
at line 132 into a standalone function which can be reused indoPing
,doPong
andsend
.What do you think?