h2 icon indicating copy to clipboard operation
h2 copied to clipboard

Support SendResponse::send_continue

Open rawler opened this issue 3 years ago • 10 comments

Support for Expect: 100-continue is mandated as MUST by https://datatracker.ietf.org/doc/html/rfc7231#section-5.1.1. Yet servers built on h2 cannot currently support this requirement.

One example of such usage, is hyper #2743.

This approach adds a send_continue method to SendResponse that a server application can use to implement support itself. This PR does not solve the feature itself, it merely provides sufficient support for a server application to implement the functionality as desired.

rawler avatar Feb 04 '22 13:02 rawler

One possible alternate solution, could be to implement more of the functionality directly, by hooking up the first attempt to read the request-body, as a signal to send 100-continue, if the header was there on the Request. Ideally, that would be implemented in Request::into_body, or add the behavior to the first call of RecvStream::poll_data. However, it seemed more invasive than I'd like it to be, and I didn't manage to wire it up in an acceptable way anyways.

rawler avatar Feb 04 '22 13:02 rawler

Thank you :pray: for a good and clear review. I've changed the according to the feedback.

rawler avatar Feb 06 '22 20:02 rawler

Ping

rawler avatar Feb 25 '22 10:02 rawler

Ping

rawler avatar May 02 '22 07:05 rawler

Ping @seanmonstar

rawler avatar Dec 12 '22 23:12 rawler

Maybe @LucioFranco have some time for a review? :pray:

rawler avatar Dec 13 '22 08:12 rawler

Any progress? It's an important feature

zh-jq avatar Apr 04 '23 14:04 zh-jq

@seanmonstar This is ready for a new review, do you have anytime to do it?

zh-jq-b avatar Jun 27 '23 02:06 zh-jq-b