forked from libp2p/rust-libp2p
-
Notifications
You must be signed in to change notification settings - Fork 0
transports/webrtc: Implement message framing #10
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
Merged
melekes
merged 44 commits into
melekes:anton/webrtc-transport
from
libp2p:webrtc-message-framing
Oct 12, 2022
Merged
Changes from 30 commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
59617de
transports/webrtc/: Test message framing sizes
mxinden 7dc3ce1
transports/webrtc/: Implement message framing
mxinden 503e32f
transports/webrtc: Update protobuf
mxinden 22e97a0
Merge remote-tracking branch 'melekes/anton/webrtc-transport' into we…
mxinden 55da918
transports/webrtc/: Change semantic of RESET
mxinden 11c016f
transports/webrtc/: Import message_proto types
mxinden 1a6e4bd
transports/webrtc/: Refactor AsyncRead match arm
mxinden d46a171
transports/webrtc/: Handle flags when read side closed
mxinden 9cd4ef7
transports/webrtc: Enforce maximum message length
mxinden 31e019a
minor refactoring
melekes 6f57ed6
rename PollDataChannel to Substream
melekes 421a8ec
Merge branch 'master' into webrtc-message-framing
melekes 4a1d4d6
add comments
melekes c6c5a96
add debug to handle_flag
melekes 1b0b671
Create noise-prologue from server + client FP in fixed order
thomaseizinger aa38c81
Make `substream` a top-level module
thomaseizinger d0e918b
Replace nightly feature with refactoring
thomaseizinger 171c613
Remove use of import rename
thomaseizinger cb481a6
Merge branch 'anton/webrtc-transport' into webrtc-message-framing
thomaseizinger 6402665
Remove unused public API
thomaseizinger d537696
Make sure we don't construct substreams outside of this crate
thomaseizinger c8c2446
Don't expose public APIs for temporary workarounds
thomaseizinger d58f219
Remove pub where not necessary
thomaseizinger eb09d36
Remove utilities below usage
thomaseizinger 99af2a1
Remove stale derive
thomaseizinger 2d85ab4
Update docs
thomaseizinger 6e2aeb1
Fix clippy warnings
thomaseizinger a6b2aac
Revert "Create noise-prologue from server + client FP in fixed order"
thomaseizinger afac31c
Merge branch 'master' into webrtc-message-framing
thomaseizinger 8266fc4
Merge remote-tracking branch 'melekes/anton/webrtc-transport' into we…
thomaseizinger d2da793
Add initial test suite for substream state machine
thomaseizinger 1b520a9
Precompute substream ID
thomaseizinger e483974
Implement new state machine
thomaseizinger 29d6f74
Reset flag clears buffer
thomaseizinger d829fda
Remove substream ID
thomaseizinger 058a153
Remove use of `map_err`
thomaseizinger e1df3c4
Replace error with `Poll::Pending`
thomaseizinger 8c8feaa
Remove unnecessary dependency
thomaseizinger e6c177c
Group imports
thomaseizinger b2961a0
Add spec wording to constant
thomaseizinger f827f62
Introduce dedicated `State` submodule
thomaseizinger 16433db
Send reset flag for dropped substreams
thomaseizinger 834ec64
Fix clippy warnings
thomaseizinger 7e0e46d
Fix docs
thomaseizinger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| // Copyright 2022 Protocol Labs. | ||
| // | ||
| // Permission is hereby granted, free of charge, to any person obtaining a | ||
| // copy of this software and associated documentation files (the "Software"), | ||
| // to deal in the Software without restriction, including without limitation | ||
| // the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
| // and/or sell copies of the Software, and to permit persons to whom the | ||
| // Software is furnished to do so, subject to the following conditions: | ||
| // | ||
| // The above copyright notice and this permission notice shall be included in | ||
| // all copies or substantial portions of the Software. | ||
| // | ||
| // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
| // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
| // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
| // DEALINGS IN THE SOFTWARE. | ||
|
|
||
| fn main() { | ||
| prost_build::compile_protos(&["src/message.proto"], &["src"]).unwrap(); | ||
| } |
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
This file was deleted.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| syntax = "proto2"; | ||
|
|
||
| package webrtc.pb; | ||
|
|
||
| message Message { | ||
| enum Flag { | ||
| // The sender will no longer send messages on the stream. | ||
| FIN = 0; | ||
| // The sender will no longer read messages on the stream. Incoming data is | ||
| // being discarded on receipt. | ||
| STOP_SENDING = 1; | ||
| // The sender abruptly terminates the sending part of the stream. The | ||
| // receiver can discard any data that it already received on that stream. | ||
| RESET = 2; | ||
| } | ||
|
|
||
| optional Flag flag=1; | ||
|
|
||
| optional bytes message = 2; | ||
| } |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.