-
Notifications
You must be signed in to change notification settings - Fork 43
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 100-continue until the body has been read from #139
Conversation
6f9b757
to
b01d8f4
Compare
b01d8f4
to
adf1604
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor nits, but overall this looks great!
src/server/decode.rs
Outdated
@@ -86,11 +88,24 @@ where | |||
"Unexpected Content-Length header" | |||
); | |||
|
|||
let (sender, receiver) = sync::channel(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With regards to #137, using async-channel may actually be better here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how much that pr/issue actually matters because async-h1 depends on http-types, which also uses unstable
Co-authored-by: Yoshua Wuyts <[email protected]>
closes #135. if a client says it expects 100-continue and we never read the body, we never send 100 continue and the client will have the option not to send a body.
this is implemented using a
ReadNotifier
which forwards BufRead and Read and sends a message on an async channel on first read. a task is spawned for each request which awaits that message and sends 100-continue.the approach to testing might have been overkill for this pr, but hopefully sets us up to do other complex testing with async-h1