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

Don't send RST_STREAM when not needed #434

Merged
merged 2 commits into from
May 10, 2024

Conversation

v0idpwn
Copy link
Contributor

@v0idpwn v0idpwn commented Apr 30, 2024

When the stream state is local_half_closed and an end_stream flag is received, the stream can be terminated normally without RST_STREAM.

Closes #433.

I still didn't work on integration tests, and while current tests kind of cover this feature, I'll add a specific test for it.

When the stream state is local_half_closed and an end_stream
flag is received, the stream can be terminated normally
without RST_STREAM.
@v0idpwn v0idpwn marked this pull request as draft April 30, 2024 02:25
@coveralls
Copy link

coveralls commented Apr 30, 2024

Pull Request Test Coverage Report for Build e6a3aac052f01725352df867c357cb80818e034f-PR-434

Details

  • 9 of 12 (75.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.1%) to 87.766%

Changes Missing Coverage Covered Lines Changed/Added Lines %
lib/mint/http2.ex 9 12 75.0%
Totals Coverage Status
Change from base Build cb43462e784e1d34215bc9da44bd4a25d0a9a5c1: -0.1%
Covered Lines: 1277
Relevant Lines: 1455

💛 - Coveralls

@v0idpwn
Copy link
Contributor Author

v0idpwn commented Apr 30, 2024

This is a WIP, I'm opening for reference. I need to double check some corner cases and maybe my implementation can be simplified.

# We send a RST_STREAM with the given error code so that we move the
# stream to the :closed state (that is, we remove it).
open?(conn) ->
error_code = if reason == :remote_end_stream, do: :no_error, else: reason
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think this line is ever used, but it doesn't feel right to remove it (?)

@v0idpwn v0idpwn marked this pull request as ready for review May 9, 2024 21:51
Copy link
Contributor Author

@v0idpwn v0idpwn left a comment

Choose a reason for hiding this comment

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

I'm not 100% happy with the implementation because I think it's a bit dirty, but it solves the problem and is pretty small, so I'm opening the PR.

@v0idpwn
Copy link
Contributor Author

v0idpwn commented May 9, 2024

Also it looks like CI is failing for totally unrelated reasons™️

@whatyouhide
Copy link
Contributor

Also it looks like CI is failing for totally unrelated reasons™️

Yes Totally Unrelated™, no worries

I'm not 100% happy with the implementation because I think it's a bit dirty, but it solves the problem and is pretty small, so I'm opening the PR.

@v0idpwn is this ready to review?

@v0idpwn
Copy link
Contributor Author

v0idpwn commented May 10, 2024

Yes!

@whatyouhide
Copy link
Contributor

Woot woot!

@whatyouhide whatyouhide merged commit f83b897 into elixir-mint:main May 10, 2024
0 of 4 checks passed
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.

Avoid unnecessary RST_STREAM frames in HTTP/2 implementation
3 participants