|
|
|
@ -45,7 +45,6 @@ import ( |
|
|
|
|
"github.com/minio/minio/cmd/logger" |
|
|
|
|
"github.com/minio/minio/pkg/handlers" |
|
|
|
|
"github.com/minio/minio/pkg/madmin" |
|
|
|
|
"golang.org/x/net/http2" |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
const ( |
|
|
|
@ -474,21 +473,26 @@ func newInternodeHTTPTransport(tlsConfig *tls.Config, dialTimeout time.Duration) |
|
|
|
|
DisableCompression: true, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if tlsConfig != nil { |
|
|
|
|
trhttp2, _ := http2.ConfigureTransports(tr) |
|
|
|
|
if trhttp2 != nil { |
|
|
|
|
// ReadIdleTimeout is the timeout after which a health check using ping
|
|
|
|
|
// frame will be carried out if no frame is received on the
|
|
|
|
|
// connection. 5 minutes is sufficient time for any idle connection.
|
|
|
|
|
trhttp2.ReadIdleTimeout = 5 * time.Minute |
|
|
|
|
// PingTimeout is the timeout after which the connection will be closed
|
|
|
|
|
// if a response to Ping is not received.
|
|
|
|
|
trhttp2.PingTimeout = dialTimeout |
|
|
|
|
// DisableCompression, if true, prevents the Transport from
|
|
|
|
|
// requesting compression with an "Accept-Encoding: gzip"
|
|
|
|
|
trhttp2.DisableCompression = true |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// https://github.com/golang/go/issues/23559
|
|
|
|
|
// https://github.com/golang/go/issues/42534
|
|
|
|
|
// https://github.com/golang/go/issues/43989
|
|
|
|
|
// https://github.com/golang/go/issues/33425
|
|
|
|
|
// https://github.com/golang/go/issues/29246
|
|
|
|
|
// if tlsConfig != nil {
|
|
|
|
|
// trhttp2, _ := http2.ConfigureTransports(tr)
|
|
|
|
|
// if trhttp2 != nil {
|
|
|
|
|
// // ReadIdleTimeout is the timeout after which a health check using ping
|
|
|
|
|
// // frame will be carried out if no frame is received on the
|
|
|
|
|
// // connection. 5 minutes is sufficient time for any idle connection.
|
|
|
|
|
// trhttp2.ReadIdleTimeout = 5 * time.Minute
|
|
|
|
|
// // PingTimeout is the timeout after which the connection will be closed
|
|
|
|
|
// // if a response to Ping is not received.
|
|
|
|
|
// trhttp2.PingTimeout = dialTimeout
|
|
|
|
|
// // DisableCompression, if true, prevents the Transport from
|
|
|
|
|
// // requesting compression with an "Accept-Encoding: gzip"
|
|
|
|
|
// trhttp2.DisableCompression = true
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
return func() http.RoundTripper { |
|
|
|
|
return tr |
|
|
|
@ -537,24 +541,26 @@ func newCustomHTTPTransport(tlsConfig *tls.Config, dialTimeout time.Duration) fu |
|
|
|
|
DisableCompression: true, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if tlsConfig != nil { |
|
|
|
|
trhttp2, _ := http2.ConfigureTransports(tr) |
|
|
|
|
if trhttp2 != nil { |
|
|
|
|
// ReadIdleTimeout is the timeout after which a health check using ping
|
|
|
|
|
// frame will be carried out if no frame is received on the
|
|
|
|
|
// connection. 5 minutes is above maximum sane scrape interval,
|
|
|
|
|
// we should not have this small overhead on the scrape connections.
|
|
|
|
|
// For other cases, this is used to validate that the connection can
|
|
|
|
|
// still be used.
|
|
|
|
|
trhttp2.ReadIdleTimeout = 5 * time.Minute |
|
|
|
|
// PingTimeout is the timeout after which the connection will be closed
|
|
|
|
|
// if a response to Ping is not received.
|
|
|
|
|
trhttp2.PingTimeout = dialTimeout |
|
|
|
|
// DisableCompression, if true, prevents the Transport from
|
|
|
|
|
// requesting compression with an "Accept-Encoding: gzip"
|
|
|
|
|
trhttp2.DisableCompression = true |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// https://github.com/golang/go/issues/23559
|
|
|
|
|
// https://github.com/golang/go/issues/42534
|
|
|
|
|
// https://github.com/golang/go/issues/43989
|
|
|
|
|
// https://github.com/golang/go/issues/33425
|
|
|
|
|
// https://github.com/golang/go/issues/29246
|
|
|
|
|
// if tlsConfig != nil {
|
|
|
|
|
// trhttp2, _ := http2.ConfigureTransports(tr)
|
|
|
|
|
// if trhttp2 != nil {
|
|
|
|
|
// // ReadIdleTimeout is the timeout after which a health check using ping
|
|
|
|
|
// // frame will be carried out if no frame is received on the
|
|
|
|
|
// // connection. 5 minutes is sufficient time for any idle connection.
|
|
|
|
|
// trhttp2.ReadIdleTimeout = 5 * time.Minute
|
|
|
|
|
// // PingTimeout is the timeout after which the connection will be closed
|
|
|
|
|
// // if a response to Ping is not received.
|
|
|
|
|
// trhttp2.PingTimeout = dialTimeout
|
|
|
|
|
// // DisableCompression, if true, prevents the Transport from
|
|
|
|
|
// // requesting compression with an "Accept-Encoding: gzip"
|
|
|
|
|
// trhttp2.DisableCompression = true
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
return func() *http.Transport { |
|
|
|
|
return tr |
|
|
|
|