mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05: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 New Issue
Block a user