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

Handle HTTP/2 half-closed connections gracefully. #777

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

karpetrosyan
Copy link
Member

@karpetrosyan karpetrosyan commented Aug 9, 2023

Closes #775

TODO:

  • Add failing tests
  • Suppress exceptions while sending the request
  • Add changelog

Comment on lines +159 to +180
hyperframe.frame.WindowUpdateFrame(
stream_id=0, window_increment=2147418112
).serialize()
+ hyperframe.frame.WindowUpdateFrame(
stream_id=1, window_increment=2147418112
).serialize()
+ hyperframe.frame.HeadersFrame(
stream_id=1,
data=hpack.Encoder().encode(
[
(b":status", b"413"),
(b"content-type", b"plain/text"),
]
),
flags=["END_HEADERS"],
).serialize()
+ hyperframe.frame.DataFrame(
stream_id=1,
data=b"Request body exceeded 1,000,000 bytes",
flags=["END_STREAM"],
).serialize()
+ hyperframe.frame.RstStreamFrame(stream_id=1, error_code=0).serialize(),
Copy link
Member

Choose a reason for hiding this comment

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

Interesting. Is it intentional/neccessary-for-the-test that the data for these frames is concatenated?

Copy link
Member Author

Choose a reason for hiding this comment

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

I ran into some issues without frame concatenation.

Copy link
Member Author

@karpetrosyan karpetrosyan Sep 1, 2023

Choose a reason for hiding this comment

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

Without cancatenation, the client has enough time to send the entire request and receives 413 with no stream errors.

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.

Handle HTTP/2 half-closed connections gracefully
2 participants