mirror of
https://github.com/minio/minio
synced 2024-07-20 18:04:21 +00:00
fix: add deadline conns and dnsCache for remote transports (#16865)
This commit is contained in:
parent
12047702f5
commit
0448728228
|
@ -639,6 +639,7 @@ const defaultDialTimeout = 5 * time.Second
|
|||
// NewHTTPTransportWithTimeout allows setting a timeout.
|
||||
func NewHTTPTransportWithTimeout(timeout time.Duration) *http.Transport {
|
||||
return xhttp.ConnSettings{
|
||||
DialContext: newCustomDialContext(),
|
||||
DNSCache: globalDNSCache,
|
||||
DialTimeout: defaultDialTimeout,
|
||||
RootCAs: globalRootCAs,
|
||||
|
@ -674,6 +675,7 @@ func newCustomDialContext() dialContext {
|
|||
func NewRemoteTargetHTTPTransport() func() *http.Transport {
|
||||
return xhttp.ConnSettings{
|
||||
DialContext: newCustomDialContext(),
|
||||
DNSCache: globalDNSCache,
|
||||
RootCAs: globalRootCAs,
|
||||
EnableHTTP2: false,
|
||||
}.NewRemoteTargetHTTPTransport()
|
||||
|
|
Loading…
Reference in a new issue