mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 06:06:27 +08:00
fs/fshttp: fix --contimeout being ignored
The following command will block for 60s(default) when the network is slow or unavailable: ``` rclone --contimeout 10s --low-level-retries 0 lsd dropbox: ``` This change will make it timeout after the expected 10s. Signed-off-by: rkonfj <rkonfj@gmail.com>
This commit is contained in:
parent
4eed3ae99a
commit
fd2322cb41
|
@ -14,10 +14,6 @@ import (
|
|||
"golang.org/x/net/ipv6"
|
||||
)
|
||||
|
||||
func dialContext(ctx context.Context, network, address string, ci *fs.ConfigInfo) (net.Conn, error) {
|
||||
return NewDialer(ctx).DialContext(ctx, network, address)
|
||||
}
|
||||
|
||||
// Dialer structure contains default dialer and timeout, tclass support
|
||||
type Dialer struct {
|
||||
net.Dialer
|
||||
|
|
|
@ -91,8 +91,8 @@ func NewTransportCustom(ctx context.Context, customize func(*http.Transport)) ht
|
|||
}
|
||||
|
||||
t.DisableCompression = ci.NoGzip
|
||||
t.DialContext = func(ctx context.Context, network, addr string) (net.Conn, error) {
|
||||
return dialContext(ctx, network, addr, ci)
|
||||
t.DialContext = func(reqCtx context.Context, network, addr string) (net.Conn, error) {
|
||||
return NewDialer(ctx).DialContext(reqCtx, network, addr)
|
||||
}
|
||||
t.IdleConnTimeout = 60 * time.Second
|
||||
t.ExpectContinueTimeout = ci.ExpectContinueTimeout
|
||||
|
|
Loading…
Reference in New Issue
Block a user