mirror of
https://github.com/pgsty/minio.git
synced 2026-07-22 13:40:22 +03:00
re-use remote transports in Peer,Storage,Locker clients (#10788)
use one transport for internode communication
This commit is contained in:
+1
-2
@@ -164,10 +164,9 @@ func (c *Client) Close() {
|
||||
}
|
||||
|
||||
// NewClient - returns new REST client.
|
||||
func NewClient(url *url.URL, newCustomTransport func() *http.Transport, newAuthToken func(aud string) string) *Client {
|
||||
func NewClient(url *url.URL, tr http.RoundTripper, newAuthToken func(aud string) string) *Client {
|
||||
// Transport is exactly same as Go default in https://golang.org/pkg/net/http/#RoundTripper
|
||||
// except custom DialContext and TLSClientConfig.
|
||||
tr := newCustomTransport()
|
||||
return &Client{
|
||||
httpClient: &http.Client{Transport: tr},
|
||||
url: url,
|
||||
|
||||
Reference in New Issue
Block a user