mirror of
https://github.com/swift-server/async-http-client.git
synced 2026-05-03 07:32:29 +00:00
7617c35db3
### 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>
33 lines
1005 B
Swift
33 lines
1005 B
Swift
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This source file is part of the AsyncHTTPClient open source project
|
|
//
|
|
// Copyright (c) 2021 Apple Inc. and the AsyncHTTPClient project authors
|
|
// Licensed under Apache License v2.0
|
|
//
|
|
// See LICENSE.txt for license information
|
|
// See CONTRIBUTORS.txt for the list of AsyncHTTPClient project authors
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
import NIOCore
|
|
|
|
struct RequestOptions {
|
|
/// The maximal `TimeAmount` that is allowed to pass between `channelRead`s from the Channel.
|
|
var idleReadTimeout: TimeAmount?
|
|
|
|
init(idleReadTimeout: TimeAmount?) {
|
|
self.idleReadTimeout = idleReadTimeout
|
|
}
|
|
}
|
|
|
|
extension RequestOptions {
|
|
static func fromClientConfiguration(_ configuration: HTTPClient.Configuration) -> Self {
|
|
RequestOptions(
|
|
idleReadTimeout: configuration.timeout.read
|
|
)
|
|
}
|
|
}
|