Skip to content

Commit

Permalink
go/libraries/doltcore/env: Do not copy the http.Transport value, whic…
Browse files Browse the repository at this point in the history
…h is not safe.
  • Loading branch information
reltuk committed Nov 2, 2024
1 parent 8d174fa commit c61adf4
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions go/libraries/doltcore/env/grpc_dial_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,19 @@ func (p GRPCDialProvider) GetGRPCDialParams(config grpcendpoint.Config) (dbfacto
tc := credentials.NewTLS(config.TLSConfig)
opts = append(opts, grpc.WithTransportCredentials(tc))

transport := *defaultTransport
transport.TLSClientConfig = config.TLSConfig
transport.ForceAttemptHTTP2 = true
transport := &http.Transport{
Proxy: http.ProxyFromEnvironment,
DialContext: defaultDialer.DialContext,
ForceAttemptHTTP2: true,
MaxIdleConns: 1024,
MaxIdleConnsPerHost: 256,
IdleConnTimeout: 90 * time.Second,
TLSClientConfig: config.TLSConfig,
TLSHandshakeTimeout: 10 * time.Second,
ExpectContinueTimeout: 1 * time.Second,
}
httpfetcher = &http.Client{
Transport: &transport,
Transport: transport,
}
} else if config.Insecure {
opts = append(opts, grpc.WithInsecure())
Expand Down

0 comments on commit c61adf4

Please sign in to comment.