mirror of
https://github.com/swift-server/async-http-client.git
synced 2026-06-02 07:37:34 +00:00
[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.
This commit is contained in:
@@ -39,7 +39,7 @@ final class HTTP1ClientChannelHandler: ChannelDuplexHandler {
|
||||
requestLogger[metadataKey: "ahc-el"] = "\(self.connection.channel.eventLoop)"
|
||||
self.logger = requestLogger
|
||||
|
||||
if let idleReadTimeout = newRequest.idleReadTimeout {
|
||||
if let idleReadTimeout = newRequest.requestOptions.idleReadTimeout {
|
||||
self.idleReadTimeoutStateMachine = .init(timeAmount: idleReadTimeout)
|
||||
}
|
||||
} else {
|
||||
@@ -146,7 +146,11 @@ final class HTTP1ClientChannelHandler: ChannelDuplexHandler {
|
||||
self.logger.debug("Request was scheduled on connection")
|
||||
req.willExecuteRequest(self)
|
||||
|
||||
let action = self.state.runNewRequest(head: req.requestHead, metadata: req.requestFramingMetadata)
|
||||
let action = self.state.runNewRequest(
|
||||
head: req.requestHead,
|
||||
metadata: req.requestFramingMetadata,
|
||||
ignoreUncleanSSLShutdown: req.requestOptions.ignoreUncleanSSLShutdown
|
||||
)
|
||||
self.run(action, context: context)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user