Skip to content
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

fix(s2n-quic-transport): optimize STOP_SENDING state #1217

Merged
merged 2 commits into from
Mar 11, 2022

Conversation

camshaft
Copy link
Contributor

@camshaft camshaft commented Mar 10, 2022

Description of changes:

When entering the STOP_SENDING state in the receive stream, we currently wait for the peer to either finish transmitting all outstanding data or send a RESET frame. This isn't really needed since the application has already indicated that it's not going to read any more data.

This change, instead, marks the stream as finalized when the STOP_SENDING frame is ACKed. Any additional frames that are received will be ignored:

// If the Stream does not exist it is no error.
state
.streams
.with_stream(stream_id, &mut state.stream_controller, |stream| {
func(stream, &mut events)
})
.unwrap_or(Ok(()))

Testing:

I've updated all of the receive stream unit tests to reflect the new behavior.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@camshaft camshaft marked this pull request as ready for review March 11, 2022 00:43
quic/s2n-quic-transport/src/stream/receive_stream.rs Outdated Show resolved Hide resolved
Co-authored-by: Wesley Rosenblum <55108558+WesleyRosenblum@users.noreply.github.com>
@camshaft camshaft merged commit eb0223b into main Mar 11, 2022
@camshaft camshaft deleted the camshaft/stop-sending-opt branch March 11, 2022 14:19
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.

2 participants