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(http2): received Body::size_hint() now return 0 if implicitly empty #2715

Merged
merged 1 commit into from
Dec 6, 2021

Conversation

seanmonstar
Copy link
Member

An HTTP/2 stream may include a set of headers, and a flag signalling
END-STREAM, even if a content-length isn't included. hyper wouldn't
notice, and so the Body would report a size-hint of 0..MAX. hyper
now notices that the stream is ended, and couldn't possibly include any
bytes for the body, and thus will give a size-hint of 0 exactly.

Closes #2712

@seanmonstar seanmonstar force-pushed the http2-eos-body-size-hint branch from 031b44e to c4745f6 Compare December 6, 2021 18:49
…mpty

An HTTP/2 stream may include a set of headers, and a flag signalling
END-STREAM, even if a `content-length` isn't included. hyper wouldn't
notice, and so the `Body` would report a size-hint of `0..MAX`. hyper
now notices that the stream is ended, and couldn't possibly include any
bytes for the body, and thus will give a size-hint of `0` exactly.
@seanmonstar seanmonstar force-pushed the http2-eos-body-size-hint branch from c4745f6 to 84935ec Compare December 6, 2021 21:33
@seanmonstar seanmonstar merged commit 84b78b6 into master Dec 6, 2021
@seanmonstar seanmonstar deleted the http2-eos-body-size-hint branch December 6, 2021 22:14
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.

body size
1 participant