mirror of
https://github.com/rclone/rclone.git
synced 2025-08-17 09:01:33 +02:00
config: make parsing of duration options consistent
All user visible Durations should be fs.Duration rather than time.Duration. Suffix is then optional and defaults to s. Additional suffices d, w, M and y are supported, in addition to ms, s, m and h - which are the only ones supported by time.Duration. Absolute times can also be specified, and will be interpreted as duration relative to now.
This commit is contained in:
@ -58,8 +58,8 @@ func NewTransportCustom(ctx context.Context, customize func(*http.Transport)) ht
|
||||
t.Proxy = http.ProxyFromEnvironment
|
||||
t.MaxIdleConnsPerHost = 2 * (ci.Checkers + ci.Transfers + 1)
|
||||
t.MaxIdleConns = 2 * t.MaxIdleConnsPerHost
|
||||
t.TLSHandshakeTimeout = ci.ConnectTimeout
|
||||
t.ResponseHeaderTimeout = ci.Timeout
|
||||
t.TLSHandshakeTimeout = time.Duration(ci.ConnectTimeout)
|
||||
t.ResponseHeaderTimeout = time.Duration(ci.Timeout)
|
||||
t.DisableKeepAlives = ci.DisableHTTPKeepAlives
|
||||
|
||||
// TLS Config
|
||||
@ -109,7 +109,7 @@ func NewTransportCustom(ctx context.Context, customize func(*http.Transport)) ht
|
||||
return NewDialer(ctx).DialContext(reqCtx, network, addr)
|
||||
}
|
||||
t.IdleConnTimeout = 60 * time.Second
|
||||
t.ExpectContinueTimeout = ci.ExpectContinueTimeout
|
||||
t.ExpectContinueTimeout = time.Duration(ci.ExpectContinueTimeout)
|
||||
|
||||
if ci.Dump&(fs.DumpHeaders|fs.DumpBodies|fs.DumpAuth|fs.DumpRequests|fs.DumpResponses) != 0 {
|
||||
fs.Debugf(nil, "You have specified to dump information. Please be noted that the "+
|
||||
|
Reference in New Issue
Block a user