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:
@@ -154,13 +154,18 @@ struct HTTP1ConnectionStateMachine {
|
||||
}
|
||||
}
|
||||
|
||||
mutating func runNewRequest(head: HTTPRequestHead, metadata: RequestFramingMetadata) -> Action {
|
||||
mutating func runNewRequest(
|
||||
head: HTTPRequestHead,
|
||||
metadata: RequestFramingMetadata,
|
||||
ignoreUncleanSSLShutdown: Bool
|
||||
) -> Action {
|
||||
guard case .idle = self.state else {
|
||||
preconditionFailure("Invalid state")
|
||||
}
|
||||
|
||||
var requestStateMachine = HTTPRequestStateMachine(
|
||||
isChannelWritable: self.isChannelWritable
|
||||
isChannelWritable: self.isChannelWritable,
|
||||
ignoreUncleanSSLShutdown: ignoreUncleanSSLShutdown
|
||||
)
|
||||
let action = requestStateMachine.startRequest(head: head, metadata: metadata)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user