-
Notifications
You must be signed in to change notification settings - Fork 51
feat: auto-tune (dynamic) stream receive window #176
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
Merged
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
71f60c4
feat: dynamic stream window
mxinden c6ca2e5
expose rtt
mxinden b8764d2
Introduce connection limit
mxinden 1839e8b
improve logging
mxinden 5dc40c2
less logging
mxinden dd4cf3a
Unbounded stream receive window
mxinden 24ca871
Rename config options
mxinden 5ee74d1
Remove max_buffer_size and rename variables
mxinden 504e876
Revert benchmark changes
mxinden 3e9a870
Refactor rtt
mxinden 8de55cf
randomize nonce
mxinden 6630c9d
Revert to u32 and add quickcheck
mxinden df2e62c
Minor clean-ups
mxinden 3fda972
Add assertions
mxinden 2892b8d
Fix deadlock
mxinden 85aef76
Move rtt into own module
mxinden a43fbee
Improve docs
mxinden bb0c6a5
Undo test changes
mxinden 5d93aa2
Remove Stream::set_flag
mxinden cf76ccf
Document MAX_FRAME_BODY_LEN
mxinden b9b74db
Introduce flow_control module
mxinden 55872bf
Remove Config::max_stream_receive_window
mxinden 4d59c6d
Reduce diff
mxinden 0ac5534
Remove unreachable buffer length exceeded
mxinden c8269b6
docs
mxinden fc6aaf7
Add explainer for asserts
mxinden d3a22b8
Remove obsolete code
mxinden db2971b
fmt
mxinden 8d69551
fmt
mxinden 8261e12
Define and use KIB MIB and GIB constants
mxinden 7581f76
Document DOS mitigation
mxinden c9c71b6
Document no ping on idle connection
mxinden 82106b0
Derive Clone
mxinden c3f581f
Remove RttState::Initial
mxinden 33c6b05
Use `Duration`'s `fmt::Debug` implementation
mxinden 68e5e1c
Refactor string formatting
mxinden aec5fd5
Add changelog entry
mxinden 79c0d11
Use shadowing over mut
mxinden 6b64a9f
Remove current_ and _size
mxinden 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| [workspace] | ||
| members = ["yamux", "test-harness"] | ||
| members = ["yamux", "test-harness", "quickcheck-ext"] | ||
| resolver = "2" |
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,13 @@ | ||
| [package] | ||
| name = "quickcheck-ext" | ||
| version = "0.1.0" | ||
| edition = "2021" | ||
| publish = false | ||
| license = "Unlicense/MIT" | ||
|
|
||
| [package.metadata.release] | ||
| release = false | ||
|
|
||
| [dependencies] | ||
| quickcheck = "1" | ||
| num-traits = "0.2" |
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,46 @@ | ||
| #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] | ||
|
|
||
| pub use quickcheck::*; | ||
|
|
||
| use core::ops::Range; | ||
| use num_traits::sign::Unsigned; | ||
|
|
||
| pub trait GenRange { | ||
| fn gen_range<T: Unsigned + Arbitrary + Copy>(&mut self, _range: Range<T>) -> T; | ||
|
|
||
| fn gen_index(&mut self, ubound: usize) -> usize { | ||
| if ubound <= (core::u32::MAX as usize) { | ||
| self.gen_range(0..ubound as u32) as usize | ||
| } else { | ||
| self.gen_range(0..ubound) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| impl GenRange for Gen { | ||
| fn gen_range<T: Unsigned + Arbitrary + Copy>(&mut self, range: Range<T>) -> T { | ||
| <T as Arbitrary>::arbitrary(self) % (range.end - range.start) + range.start | ||
| } | ||
| } | ||
|
|
||
| pub trait SliceRandom { | ||
| fn shuffle<T>(&mut self, arr: &mut [T]); | ||
| fn choose_multiple<'a, T>( | ||
| &mut self, | ||
| arr: &'a [T], | ||
| amount: usize, | ||
| ) -> std::iter::Take<std::vec::IntoIter<&'a T>> { | ||
| let mut v: Vec<&T> = arr.iter().collect(); | ||
| self.shuffle(&mut v); | ||
| v.into_iter().take(amount) | ||
| } | ||
| } | ||
|
|
||
| impl SliceRandom for Gen { | ||
| fn shuffle<T>(&mut self, arr: &mut [T]) { | ||
| for i in (1..arr.len()).rev() { | ||
| // invariant: elements with index > i have been locked in place. | ||
| arr.swap(i, self.gen_index(i + 1)); | ||
| } | ||
| } | ||
| } |
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
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
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.