Commit Graph

9 Commits

Author SHA1 Message Date
Fabian Fett 7617c35db3 Handle NIOSSLError.uncleanShutdown correctly (#472)
### Motivation

Fixes #238 and #231.

### Changes

- Extracted the unclean shutdown test from `HTTPClientTests` into their own file `HTTPClientUncleanSSLConnectionShutdownTests`
- Copy and pasted @weissi great explanation from #238 into the test file
- Removed property `ignoreUncleanSSLShutdown` everywhere

### Result

`ignoreUncleanSSLShutdown` on `HTTPClient.Configuration` is deprecated and ignored.

Co-authored-by: Johannes Weiss <johannesweiss@apple.com>
2021-11-11 11:02:54 +01:00
Fabian Fett 170fd536f9 Support informational response heads (#469) 2021-11-10 13:33:38 +01:00
Fabian Fett 16ad7588b1 [HTTP1Connection] Handle 101 Switching Protocols (#442) 2021-09-28 09:52:26 +02:00
Fabian Fett 64fbfdaeda [HTTP1Connection] Option to ignore unclean ssl shutdown errors (#432)
- a new `RequestOptions` struct was created, that can be used to set request specific options. It is required by the `HTTPExecutableRequest`
- Added support for `ignoreUncleanSSLShutdown` in the `HTTPRequestStateMachine` and the `HTTP1ConnectionStateMachine`. In http/2 `ignoreUncleanSSLShutdown` is always off.
2021-09-21 10:04:17 +02:00
Fabian Fett bef8878ede ChannelRead because of closing connection: Remove preconditions (#430)
### Motivation

NIO may send `channelRead` events without a handlers requesting more data with a `context.read()` invocation. This happens if the remote has closed the connection and NIO wants to inform the handlers as soon as possible.

### Changes

- Don't `precondition` on `channelRead` events anymore.
- Close channel if we received an http end without a `context.read()` invocation
2021-09-20 18:11:04 +02:00
Fabian Fett eab2a84b1c Use explicit NIO imports (#407)
* Use explicit NIO imports for `NIOCore`, `NIOPosix` and `NIOEmbedded`
* Updated dependencies
2021-08-19 21:11:49 +02:00
Fabian Fett 388b8dc14a Add HTTP2Connection (#401)
Co-authored-by: George Barnett <gbarnett@apple.com>
2021-07-22 18:30:37 +02:00
Fabian Fett fcb0f21bfd Buffer channelReads in ResponseStreamState until the next channelReadComplete (#388)
- `ConsumerControlState` was replaced with `ResponseStreamState` in `HTTPRequestStateMachine`
- `channelRead`s are buffered up to a `channelReadComplete`.
- on `channelReadComplete` all buffered body parts are forwarded to the consumer
2021-07-07 13:30:22 +02:00
Fabian Fett cd7c8048a8 Add HTTPRequestStateMachine (#386)
This commit adds an explicit `HTTPRequestStateMachine`. It is intended to be used in two instances in the future:

1. As a substate machine for a `HTTP1ConnectionStateMachine`, when the connection is in a request.
2. As a state machine for a `HTTP2RequestHandler` that operates on a single http2 stream created by the multiplexer.

The new code paths are not triggered today, but will be enabled in the future.
2021-07-05 15:25:09 +02:00