-
-
Notifications
You must be signed in to change notification settings - Fork 317
New send flow control #25
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
Conversation
olix0r
left a comment
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.
the high-level api seems sufficient to me. once we can release capacity, we'll be able to add some RAII'd helper on top of this, which will be cool.
src/proto/streams/flow_control.rs
Outdated
| /// must ensure that the window has capacity. | ||
| pub fn send_data(&mut self, sz: WindowSize) { | ||
| assert!(sz <= self.window_size as WindowSize); | ||
| self.window_size -= sz as i32; |
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.
as noted in chat, we'll also need to account for what happens when the initial window size is decreased.
| return Ok(()); | ||
| } else if capacity < stream.requested_send_capacity { | ||
| // TODO: release capacity | ||
| unimplemented!(); |
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.
... ;)
|
Ok, I restructured the send flow control such that data writes are always accepted. This will make it easier to accept SETTINGS frames that decrease the window. |
…erium#25) This helps finding the root cause of why the assertion in FlowControl::dec_send_window failed in the first place. See hyperium#692 for more details. Co-authored-by: Anthony Ramine <[email protected]>
This is a work in progress