diff --git a/Packages/ClientRuntime/Sources/Networking/Http/CRT/CRTClientEngine.swift b/Packages/ClientRuntime/Sources/Networking/Http/CRT/CRTClientEngine.swift index 1c545c56d..11e380995 100644 --- a/Packages/ClientRuntime/Sources/Networking/Http/CRT/CRTClientEngine.swift +++ b/Packages/ClientRuntime/Sources/Networking/Http/CRT/CRTClientEngine.swift @@ -13,7 +13,6 @@ import AwsCommonRuntimeKit public class CRTClientEngine: HttpClientEngine { private var logger: LogAgent - private var crtLogger: Logger private var connectionPools: [Endpoint: HttpClientConnectionManager] = [:] private let CONTENT_LENGTH_HEADER = "Content-Length" private let AWS_COMMON_RUNTIME = "AwsCommonRuntime" @@ -27,7 +26,6 @@ public class CRTClientEngine: HttpClientEngine { self.maxConnectionsPerEndpoint = config.maxConnectionsPerEndpoint self.windowSize = config.windowSize self.logger = SwiftLogger(label: "CRTClientEngine") - self.crtLogger = Logger(pipe: stdout, level: .none, allocator: defaultAllocator) } private func createConnectionPool(endpoint: Endpoint) -> HttpClientConnectionManager { diff --git a/Packages/ClientRuntime/Sources/Networking/Http/CRT/SDKDefaultIO.swift b/Packages/ClientRuntime/Sources/Networking/Http/CRT/SDKDefaultIO.swift index 71f654983..1bfcdb9c2 100644 --- a/Packages/ClientRuntime/Sources/Networking/Http/CRT/SDKDefaultIO.swift +++ b/Packages/ClientRuntime/Sources/Networking/Http/CRT/SDKDefaultIO.swift @@ -7,9 +7,14 @@ import AwsCommonRuntimeKit import class Foundation.ProcessInfo +#if os(Linux) +import Glibc +#else +import Darwin +#endif public final class SDKDefaultIO { - static weak var privateShared: SDKDefaultIO? = nil + static weak var privateShared: SDKDefaultIO? // TODO: revisit this and verify that it is thread safe. public static var shared: SDKDefaultIO { @@ -26,9 +31,11 @@ public final class SDKDefaultIO { public var hostResolver: DefaultHostResolver public var clientBootstrap: ClientBootstrap public var tlsContext: TlsContext + public var logger: Logger private init() { AwsCommonRuntimeKit.initialize() + self.logger = Logger(pipe: stdout, level: .none, allocator: defaultAllocator) self.eventLoopGroup = EventLoopGroup(threadCount: 0) self.hostResolver = DefaultHostResolver(eventLoopGroup: eventLoopGroup, maxHosts: 8,