@@ -414,13 +414,11 @@ final class ConnectionPool {
414414
415415 private func makeConnection( on eventLoop: EventLoop ) -> EventLoopFuture < Connection > {
416416 self . activityPrecondition ( expected: [ . opened] )
417- let handshakePromise = eventLoop. makePromise ( of: Void . self)
418417 let address = HTTPClient . resolveAddress ( host: self . key. host, port: self . key. port, proxy: self . configuration. proxy)
419418 let bootstrap : NIOClientTCPBootstrap
420419 do {
421420 bootstrap = try makeHTTPClientBootstrapBase ( on: eventLoop)
422421 } catch {
423- handshakePromise. fail ( error)
424422 return eventLoop. makeFailedFuture ( error)
425423 }
426424
@@ -433,10 +431,8 @@ final class ConnectionPool {
433431 }
434432
435433 return channel. flatMap { channel -> EventLoopFuture < ConnectionPool . Connection > in
436- handshakePromise. succeed ( ( ) )
437- return handshakePromise. futureResult. flatMap {
438- channel. pipeline. addHTTPClientHandlers ( leftOverBytesStrategy: . forwardBytes)
439- } . map {
434+
435+ channel. pipeline. addHTTPClientHandlers ( leftOverBytesStrategy: . forwardBytes) . map {
440436 let connection = Connection ( key: self . key, channel: channel, parentPool: self . parentPool)
441437 connection. isLeased = true
442438 return connection
@@ -445,9 +441,6 @@ final class ConnectionPool {
445441 self . configureCloseCallback ( of: connection)
446442 return connection
447443 } . flatMapError { error in
448- // This promise may not have been completed if we reach this
449- // so we fail it to avoid any leak
450- handshakePromise. fail ( error)
451444 let action = self . parentPool. connectionProvidersLock. withLock {
452445 self . stateLock. withLock {
453446 self . state. failedConnectionAction ( )
0 commit comments