Skip to content

Conversation

@carllerche
Copy link
Collaborator

This is a work in progress

Copy link
Collaborator

@olix0r olix0r left a 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.

/// 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;
Copy link
Collaborator

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!();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... ;)

@carllerche
Copy link
Collaborator Author

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.

@carllerche carllerche merged commit a623ab6 into master Aug 21, 2017
@carllerche carllerche deleted the new-send-flow-control branch August 23, 2017 18:23
cxw620 pushed a commit to hanyu-dev/miku-h2 that referenced this pull request Jan 20, 2025
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants