feat(http1): support expect: 100-continue on the client - #4182
Conversation
| #[cfg(feature = "client")] | ||
| if seen_continue { | ||
| self.release_continue(); | ||
| } |
There was a problem hiding this comment.
Had to include this before the parse result match because otherwise the early return in the Pending arm would never flip the state and deadlock.
|
Thanks for the PR! One thing I'll note, what I hoped to describe in #3833 is that this can be done completely outside of hyper, and we could provide helpers to do so in hyper-util. Would you be up for trying to port to helpers over there? |
Ah right, jumped into implementing without reading thoroughly enough. Ye no problem, will do. |
Handle the
Expect: 100-continueheader fully.https://www.rfc-editor.org/rfc/rfc9110.html#name-expect
This adds the missing handling logic of the header. The client didn't handle the header previously.
If there's the
Expect: 100-continueheader present the client only writes the head and parks the body.If the server returns
100 Continuethen go on and write the body.If the server returns any non-1xx response the client drops the body and closes the connection.
Empty body ignores the header completely.
Also add a configurable timer to the client, client sends the body after the timeout, only if there's a timer setup, if not then it waits indefinitely.
Closes #3833