File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
Sources/ClientRuntime/Networking/Http/NIO Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ //
2+ // Copyright Amazon.com Inc. or its affiliates.
3+ // All Rights Reserved.
4+ //
5+ // SPDX-License-Identifier: Apache-2.0
6+ //
7+
8+ import AsyncHTTPClient
9+ import NIOCore
10+
11+ extension HTTPClient . Configuration {
12+
13+ static func from( httpClientConfiguration: HttpClientConfiguration ) -> HTTPClient . Configuration {
14+ let connect : TimeAmount ? = httpClientConfiguration. connectTimeout != nil
15+ ? . seconds( Int64 ( httpClientConfiguration. connectTimeout!) )
16+ : nil
17+
18+ let read : TimeAmount ? = . seconds( Int64 ( httpClientConfiguration. socketTimeout) )
19+
20+ let timeout = HTTPClient . Configuration. Timeout (
21+ connect: connect,
22+ read: read
23+ )
24+
25+ let pool = HTTPClient . Configuration. ConnectionPool (
26+ idleTimeout: . seconds( 60 ) , // default
27+ concurrentHTTP1ConnectionsPerHostSoftLimit: httpClientConfiguration. maxConnections
28+ )
29+
30+ return . init(
31+ tlsConfiguration: nil , // TODO
32+ redirectConfiguration: nil ,
33+ timeout: timeout,
34+ connectionPool: pool,
35+ proxy: nil ,
36+ ignoreUncleanSSLShutdown: false ,
37+ decompression: . disabled
38+ )
39+ }
40+ }
You can’t perform that action at this time.
0 commit comments