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

[Backport] HTTP Expect: 100-continue (#2037) #2079

Merged
merged 1 commit into from
Feb 9, 2022

Conversation

idelpivnitskiy
Copy link
Member

Motivation:

Add support for Expect: 100-continue header to allow users deffer
sending request payload body until server signals that it's ready to
receive it.

Modification:

  • Enhance HttpObjectEncoder, HttpObjectDecoder,
    AbstractH2DuplexHandler, their subclasses, and NettyHttpServer to
    support new feature;
  • DefaultNettyConnection: add ContinueUserEvent and
    CancelWriteUserEvent;
  • WriteStreamSubscriber: add continueWriting() and
    terminateSource() to support continuation;
  • Fix WriteStreamSubscriber#channelWritable() to make
    initialRequestN if subscription was assigned while a channel was not
    writable;
  • RequestResponseCloseHandler and NonPipelinedCloseHandler: fire
    OutboundDataEndEvent only when it ends outbound data but not when
    CancelWriteUserEvent;
  • HttpProtocolVersion: implement Comparable interface to allow
    easier version number comparison;
  • RetryingHttpRequesterFilter: add retryExpectationFailed(boolean)
    feature and public ExpectationFailedException;
  • Test new behavior;
  • Add docs section about Expect: 100-continue for http-api module;

Result:

HTTP supports Expect: 100-continue feature on client and server sides.

Motivation:

Add support for `Expect: 100-continue` header to allow users deffer
sending request payload body until server signals that it's ready to
receive it.

Modification:

- Enhance `HttpObjectEncoder`, `HttpObjectDecoder`,
`AbstractH2DuplexHandler`, their subclasses, and `NettyHttpServer` to
support new feature;
- `DefaultNettyConnection`: add `ContinueUserEvent` and
`CancelWriteUserEvent`;
- `WriteStreamSubscriber`: add `continueWriting()` and
`terminateSource()` to support continuation;
- Fix `WriteStreamSubscriber#channelWritable()` to make
`initialRequestN` if subscription was assigned while a channel was not
writable;
- `RequestResponseCloseHandler` and `NonPipelinedCloseHandler`: fire
`OutboundDataEndEvent` only when it ends outbound data but not when
`CancelWriteUserEvent`;
- `HttpProtocolVersion`: implement `Comparable` interface to allow
easier version number comparison;
- `RetryingHttpRequesterFilter`: add `retryExpectationFailed(boolean)`
feature and public `ExpectationFailedException`;
- Test new behavior;
- Add docs section about `Expect: 100-continue` for http-api module;

Result:

HTTP supports `Expect: 100-continue` feature on client and server sides.
@idelpivnitskiy idelpivnitskiy merged commit 20f62ae into apple:0.41 Feb 9, 2022
@idelpivnitskiy idelpivnitskiy deleted the 0.41-expect-continue branch February 9, 2022 18:09
idelpivnitskiy added a commit that referenced this pull request Feb 9, 2022
Motivation:

#2079 added a new argument for 2 public methods of
`io.servicetalk.transport.netty.internal.DefaultNettyConnection`.
While this is an internal class, we should be extra cautious with any
incompatible changes in 0.41 branch.

Modifications:

- Add 2 more overloads for pre-existing methods and mark them as
`@Deprecated`;

Result:

`servicetalk-transport-netty-internal` module is backward compatible
with 0.41.13.
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.

1 participant