How to correctly buffer an HTTP/2 request into memory? #3839
Unanswered
zacknewman
asked this question in
Q&A
Replies: 1 comment 2 replies
-
I thought we had used the word "hint" in the description, because that's what |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
A cursory read of RFC 9113 seems to suggest that a request stream is closed iff a frame with END_STREAM set has been received. § 6.1 also states that an empty DATA frame with END_STREAM set is allowed to indicate the stream is over.
hyper
/h2
have some mechanism that checks for "an empty DATA frame attack"? For example a threshold of consecutive empty DATA frames that when exceeded causes an error?Body::is_end_stream
presumably is based on a frame with END_STREAM set having been received. The documentation for that function explicitly states thatBody::poll_frame
can returnPoll::Ready(None)
even when this returnsfalse
. This, in addition to my interpretation of RFC 9113, suggests to me that the body of a request that is to be buffered into memory should be based on thisbool
and not based on whenNone
is received; howeverhttp_body_util::combinators::Collect::poll
seems to (mis)interpretNone
as end of stream. Shouldn'tCollect::poll
instead returnPoll::Ready
iffT::is_end_stream
returnstrue
? Perhaps it can have a threshold of consecutiveNone
s that when exceeded causes an error to be returned.Beta Was this translation helpful? Give feedback.
All reactions