File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -454,7 +454,7 @@ class HTTP1ConnectionProvider {
454
454
logger: Logger ) -> EventLoopFuture < Channel > {
455
455
let connectionID = HTTPConnectionPool . Connection. ID. globalGenerator. next ( )
456
456
let eventLoop = preference. bestEventLoop ?? self . eventLoop
457
- let deadline = NIODeadline . now ( ) + ( self . configuration. timeout. connect ?? . seconds ( 10 ) )
457
+ let deadline = . now( ) + self . configuration. timeout. connectionCreationTimeout
458
458
return self . factory. makeHTTP1Channel (
459
459
connectionID: connectionID,
460
460
deadline: deadline,
Original file line number Diff line number Diff line change @@ -833,10 +833,16 @@ extension HTTPClient.Configuration {
833
833
/// Specifies read timeout.
834
834
public var read : TimeAmount ?
835
835
836
+ /// internal connection creation timeout. Defaults the connect timeout to always contain a value.
837
+ var connectionCreationTimeout : TimeAmount {
838
+ self . connect ?? . seconds( 10 )
839
+ }
840
+
836
841
/// Create timeout.
837
842
///
838
843
/// - parameters:
839
- /// - connect: `connect` timeout.
844
+ /// - connect: `connect` timeout. Will default to 10 seconds, if no value is
845
+ /// provided. See `var connectionCreationTimeout`
840
846
/// - read: `read` timeout.
841
847
public init ( connect: TimeAmount ? = nil , read: TimeAmount ? = nil ) {
842
848
self . connect = connect
You can’t perform that action at this time.
0 commit comments