mirror of
https://github.com/rclone/rclone.git
synced 2025-01-24 12:56:36 +02:00
fs/fshttp: limit MaxIdleConns and MaxIdleConnsPerHost
Before this change mega (which uses a different host per download) would open too many sockets.
This commit is contained in:
parent
4b5ff33125
commit
37be78705d
@ -126,7 +126,8 @@ func NewTransport(ci *fs.ConfigInfo) http.RoundTripper {
|
|||||||
t := new(http.Transport)
|
t := new(http.Transport)
|
||||||
setDefaults(t, http.DefaultTransport.(*http.Transport))
|
setDefaults(t, http.DefaultTransport.(*http.Transport))
|
||||||
t.Proxy = http.ProxyFromEnvironment
|
t.Proxy = http.ProxyFromEnvironment
|
||||||
t.MaxIdleConnsPerHost = 4 * (ci.Checkers + ci.Transfers + 1)
|
t.MaxIdleConnsPerHost = 2 * (ci.Checkers + ci.Transfers + 1)
|
||||||
|
t.MaxIdleConns = 2 * t.MaxIdleConnsPerHost
|
||||||
t.TLSHandshakeTimeout = ci.ConnectTimeout
|
t.TLSHandshakeTimeout = ci.ConnectTimeout
|
||||||
t.ResponseHeaderTimeout = ci.Timeout
|
t.ResponseHeaderTimeout = ci.Timeout
|
||||||
t.TLSClientConfig = &tls.Config{InsecureSkipVerify: ci.InsecureSkipVerify}
|
t.TLSClientConfig = &tls.Config{InsecureSkipVerify: ci.InsecureSkipVerify}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user