@@ -16,8 +16,8 @@ import Foundation
1616import NIO
1717import NIOConcurrencyHelpers
1818import NIOHTTP1
19- import NIOTransportServices
2019import NIOTLS
20+ import NIOTransportServices
2121
2222/// A connection pool that manages and creates new connections to hosts respecting the specified preferences
2323///
@@ -376,9 +376,9 @@ final class ConnectionPool {
376376 self . activityPrecondition ( expected: [ . opened] )
377377 let address = HTTPClient . resolveAddress ( host: self . key. host, port: self . key. port, proxy: self . configuration. proxy)
378378 let requiresTLS = self . key. scheme == . https
379- let bootstrap : NIOClientTCPBootstrap
379+ let bootstrap : NIOClientTCPBootstrap
380380 do {
381- bootstrap = try NIOClientTCPBootstrap . makeHTTPClientBootstrapBase ( on: eventLoop, host: key. host, port: key. port, requiresTLS: requiresTLS, configuration: self . configuration)
381+ bootstrap = try NIOClientTCPBootstrap . makeHTTPClientBootstrapBase ( on: eventLoop, host: self . key. host, port: self . key. port, requiresTLS: requiresTLS, configuration: self . configuration)
382382 } catch {
383383 return eventLoop. makeFailedFuture ( error)
384384 }
@@ -396,28 +396,28 @@ final class ConnectionPool {
396396 let requiresSSLHandler = self . configuration. proxy != nil && self . key. scheme == . https
397397 channel. pipeline. addSSLHandlerIfNeeded ( for: self . key, tlsConfiguration: self . configuration. tlsConfiguration, addSSLClient: requiresSSLHandler, handshakePromise: handshakePromise)
398398 return handshakePromise. futureResult. flatMap {
399- channel. pipeline. addHTTPClientHandlers ( leftOverBytesStrategy: . forwardBytes)
399+ channel. pipeline. addHTTPClientHandlers ( leftOverBytesStrategy: . forwardBytes)
400400 } . flatMap {
401401 #if canImport(Network)
402- if #available( OSX 10 . 14 , iOS 12 . 0 , tvOS 12 . 0 , watchOS 6 . 0 , * ) , bootstrap. underlyingBootstrap is NIOTSConnectionBootstrap {
403- return channel. pipeline. addHandler ( NWErrorHandler ( ) , position: . first)
404- }
402+ if #available( OSX 10 . 14 , iOS 12 . 0 , tvOS 12 . 0 , watchOS 6 . 0 , * ) , bootstrap. underlyingBootstrap is NIOTSConnectionBootstrap {
403+ return channel. pipeline. addHandler ( NWErrorHandler ( ) , position: . first)
404+ }
405405 #endif
406406 return eventLoop. makeSucceededFuture ( ( ) )
407407 } . map {
408- let connection = Connection ( key: self . key, channel: channel, parentPool: self . parentPool)
409- connection. isLeased = true
410- return connection
408+ let connection = Connection ( key: self . key, channel: channel, parentPool: self . parentPool)
409+ connection. isLeased = true
410+ return connection
411411 }
412412 } . map { connection in
413413 self . configureCloseCallback ( of: connection)
414414 return connection
415415 } . flatMapError { error in
416416 var error = error
417417 #if canImport(Network)
418- if #available( OSX 10 . 14 , iOS 12 . 0 , tvOS 12 . 0 , watchOS 6 . 0 , * ) , bootstrap. underlyingBootstrap is NIOTSConnectionBootstrap {
419- error = NWErrorHandler . translateError ( error)
420- }
418+ if #available( OSX 10 . 14 , iOS 12 . 0 , tvOS 12 . 0 , watchOS 6 . 0 , * ) , bootstrap. underlyingBootstrap is NIOTSConnectionBootstrap {
419+ error = NWErrorHandler . translateError ( error)
420+ }
421421 #endif
422422 // This promise may not have been completed if we reach this
423423 // so we fail it to avoid any leak
0 commit comments