-
Notifications
You must be signed in to change notification settings - Fork 79
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
Patch to properly return an io.ErrShortBuffer #51
Conversation
If the reassemblyQueue returns an io.ErrShortBuffer, this error is returned instead of being overwritten and lost
Added name to list of contributers on README
Ah, I'm seeing an issue now about how the caller should handle the error. I think it's a good idea to allow the caller to try again with a larger buffer. Right now the reassemblyQueue increments the SSN and removes the chunkset from the list. I think the reassembly queue should leave the chunkset in the list until the read returns without error. |
Codecov Report
@@ Coverage Diff @@
## master #51 +/- ##
=========================================
- Coverage 75.72% 75.63% -0.1%
=========================================
Files 43 43
Lines 2612 2618 +6
=========================================
+ Hits 1978 1980 +2
- Misses 510 512 +2
- Partials 124 126 +2
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.
I missed the changes to leaving the message in the queue. Let me review it a bit later!
TODO: investigate WebRTC protocol spec, and EOR (e.g. this article |
This is super exciting, thanks for the contribution @cohosh :) I added you to the Pion organization, when the PR gets approved you will be able to merge it right away. I really hope we can make If there is anything I can do personally I am always happy to help! We have a Slack and always feel free to drop me an email sean @ pion.ly :) |
Thanks! It's probably a good idea to address the changes to the datachannel read loop along with this change: pion/webrtc#719 |
Also you can follow the integration to Snowflake here: https://trac.torproject.org/projects/tor/ticket/28942 |
@cohosh An alternative to this can be our detach API: This enables you to read from the data channel in an idiomatic way: |
Hi @backkem ! |
Oh, also just to confirm... it seems detaching the channel still requires this SCTP patch otherwise the io.ErrShortBuffer won't be returned. So channel detachment is really in case you decide to handle the io.ErrShortBuffer differently than this PR: pion/webrtc#719. It would also allow us to specify a larger buffer. Is that a good summary? |
Hey, as mention in pion/webrtc#718, I updated this patch to remove the modifications to the reassembly_queue, but keep the |
Added a unit test to increase code coverage for the new io.ErrShortBuffer return
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.
Thanks for your PR + test!! It looks good to me.
Thanks! |
If the reassemblyQueue returns an io.ErrShortBuffer, this error is
returned instead of being overwritten and lost
Description
Since the datachannel read loop https://github.com/pion/webrtc/blob/master/datachannel.go#L292 is checking for io.ErrShortBuffer errors, the best thing to do is simply return this error from Stream.ReadSCTP
and let the calling functions handle it.
See https://trac.torproject.org/projects/tor/ticket/28942#comment:15
Reference issue
Fixes #50