mirror of
https://github.com/rclone/rclone.git
synced 2024-12-23 15:38:57 +01: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)
|
||||
setDefaults(t, http.DefaultTransport.(*http.Transport))
|
||||
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.ResponseHeaderTimeout = ci.Timeout
|
||||
t.TLSClientConfig = &tls.Config{InsecureSkipVerify: ci.InsecureSkipVerify}
|
||||
|
Loading…
Reference in New Issue
Block a user