Skip to content

Commit

Permalink
Drop DialWithBackOff from newHTTPSTransport
Browse files Browse the repository at this point in the history
  • Loading branch information
nak3 committed Oct 3, 2023
1 parent 6597200 commit 3915a0b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions network/transports.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ func dialBackOffHelper(ctx context.Context, network, address string, bo wait.Bac

func newHTTPTransport(disableKeepAlives, disableCompression bool, maxIdle, maxIdlePerHost int) http.RoundTripper {
transport := http.DefaultTransport.(*http.Transport).Clone()
transport.DialContext = DialWithBackOff
transport.DisableKeepAlives = disableKeepAlives
transport.MaxIdleConns = maxIdle
transport.MaxIdleConnsPerHost = maxIdlePerHost
Expand All @@ -131,7 +130,6 @@ type DialTLSContextFunc func(ctx context.Context, network, addr string) (net.Con

func newHTTPSTransport(disableKeepAlives, disableCompression bool, maxIdle, maxIdlePerHost int, tlsContext DialTLSContextFunc) http.RoundTripper {
transport := http.DefaultTransport.(*http.Transport).Clone()
transport.DialContext = DialWithBackOff
transport.DisableKeepAlives = disableKeepAlives
transport.MaxIdleConns = maxIdle
transport.MaxIdleConnsPerHost = maxIdlePerHost
Expand All @@ -150,7 +148,7 @@ func NewProberTransport() http.RoundTripper {
NewH2CTransport())
}

// NewProxyAutoTLSTransport is same with NewProxyAutoTransport but it has DialTLSContextFunc to create HTTPS request.
// NewProxyAutoTLSTransport is same with NewProxyAutoTransport but it has tls.Config to create HTTPS request.
func NewProxyAutoTLSTransport(maxIdle, maxIdlePerHost int, tlsContext DialTLSContextFunc) http.RoundTripper {
return newAutoTransport(
newHTTPSTransport(false /*disable keep-alives*/, true /*disable auto-compression*/, maxIdle, maxIdlePerHost, tlsContext),
Expand Down

0 comments on commit 3915a0b

Please sign in to comment.