-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Websockets: implement reading fragmented message [WIP] #638
Conversation
Codecov Report
@@ Coverage Diff @@
## master #638 +/- ##
==========================================
+ Coverage 75.59% 77.54% +1.95%
==========================================
Files 36 36
Lines 2151 2320 +169
==========================================
+ Hits 1626 1799 +173
+ Misses 525 521 -4
Continue to review full report at Codecov.
|
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.
Oof, this seems like hefty changes without a goto person to review; could you add tests around the change in functionality?
I added some tests to read a fragmented message when receiving from both a remote and local server. We actually already had a method to send fragmented messages so that was pretty simple. |
If it helps, I have been playing with WebSockets for a little while in Java/MATLAB: https://github.com/jebej/MatlabWebSocket I added the fragmented message support recently, which is when I noticed it wasn't supported here. |
I'm now noticing that there was some support already when using This bypasses looking for the continuation and final frames entirely, and relies instead on an There are multiple issues with this
I'm not sure what is preferred here. I can do a deeper refactor to fix this if desired. |
This was the case before this PR, since |
|
allow reading fragmented message by checking the `final` property of each message's header
69e11ed
to
ad62fc7
Compare
I changed the PR to keep the same interface for
I also fixed a type-instability: previously |
I think the PR is in pretty good shape as-is. A refactor can build on top of this in an other PR. I actually fixed a bug when receiving a pong in the middle of multiple frames: before I added a test for this by manually writing out a fragmented message with a ping. |
Ok great. Happy to merge now then. The websockets code in HTTP.jl could certainly use a maintainer if you're willing to help out; obviously this is open-source and there's no obligation at all, but the original author of the websocket code here isn't active in the project anymore and so it hasn't received the level of testing/bug-fixes/updating as the rest of the code. |
Allow reading fragmented message by checking the
final
property of each message's header. With this I was able to read a broken-up message from a server properly.Let me know if this is a good direction, of if some refactoring is needed.