Skip to content

Commit

Permalink
fix: fixes an issue with creation of crt Logger (#393)
Browse files Browse the repository at this point in the history
  • Loading branch information
kneekey23 authored Jan 4, 2022
1 parent 3ca4723 commit 6d07a94
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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,
Expand Down

0 comments on commit 6d07a94

Please sign in to comment.