diff options
Diffstat (limited to 'deps/undici/src/lib/client.js')
-rw-r--r-- | deps/undici/src/lib/client.js | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/deps/undici/src/lib/client.js b/deps/undici/src/lib/client.js index 983e703479..9dbd2eefe4 100644 --- a/deps/undici/src/lib/client.js +++ b/deps/undici/src/lib/client.js @@ -109,7 +109,9 @@ class Client extends DispatcherBase { connect, maxRequestsPerClient, localAddress, - maxResponseSize + maxResponseSize, + autoSelectFamily, + autoSelectFamilyAttemptTimeout } = {}) { super() @@ -185,12 +187,20 @@ class Client extends DispatcherBase { throw new InvalidArgumentError('maxResponseSize must be a positive number') } + if ( + autoSelectFamilyAttemptTimeout != null && + (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1) + ) { + throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number') + } + if (typeof connect !== 'function') { connect = buildConnector({ ...tls, maxCachedSessions, socketPath, timeout: connectTimeout, + ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined), ...connect }) } @@ -212,8 +222,8 @@ class Client extends DispatcherBase { this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\r\n` - this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 30e3 - this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 30e3 + this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3 + this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3 this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength this[kMaxRedirections] = maxRedirections this[kMaxRequests] = maxRequestsPerClient |