"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
fshttp: add --expect-continue-timeout default 1s - fixes #3835
Nick Craig-Wood277d94feac56
diff --git a/docs/content/docs.md b/docs/content/docs.mdindex f2cf1d72e..02dc47f4b 100644--- a/docs/content/docs.md+++ b/docs/content/docs.md@@ -539,6 +539,19 @@ Do a trial run with no permanent changes. Use this to see what rclonewould do without actually doing it. Useful when setting up the `sync`command which deletes files in the destination.+### --expect-continue-timeout=TIME ###++This specifies the amount of time to wait for a server's first+response headers after fully writing the request headers if the+request has an "Expect: 100-continue" header. Not all backends support+using this.++Zero means no timeout and causes the body to be sent immediately,+without waiting for the server to approve. This time does not include+the time to send the request header.++The default is `1s`. Set to 0 to disable.+### --ignore-case-sync ###Using this option will cause rclone to ignore the case of the filesdiff --git a/fs/config.go b/fs/config.goindex b497ac7dd..54675ffab 100644--- a/fs/config.go+++ b/fs/config.go@@ -54,6 +54,7 @@ type ConfigInfo struct {Transfers intConnectTimeout time.Duration // Connect timeoutTimeout time.Duration // Data channel timeout+ ExpectContinueTimeout time.DurationDump DumpFlagsInsecureSkipVerify bool // Skip server certificate verificationDeleteMode DeleteMode@@ -121,6 +122,7 @@ func NewConfig() *ConfigInfo {c.Transfers = 4c.ConnectTimeout = 60 * time.Secondc.Timeout = 5 * 60 * time.Second+ c.ExpectContinueTimeout = 1 * time.Secondc.DeleteMode = DeleteModeDefaultc.MaxDelete = -1c.LowLevelRetries = 10diff --git a/fs/config/configflags/configflags.go b/fs/config/configflags/configflags.goindex 3ae0cbf64..16ad272d9 100644--- a/fs/config/configflags/configflags.go+++ b/fs/config/configflags/configflags.go@@ -50,6 +50,7 @@ func AddFlags(flagSet *pflag.FlagSet) {flags.BoolVarP(flagSet, &fs.Config.DryRun, "dry-run", "n", fs.Config.DryRun, "Do a trial run with no permanent changes")flags.DurationVarP(flagSet, &fs.Config.ConnectTimeout, "contimeout", "", fs.Config.ConnectTimeout, "Connect timeout")flags.DurationVarP(flagSet, &fs.Config.Timeout, "timeout", "", fs.Config.Timeout, "IO idle timeout")+ flags.DurationVarP(flagSet, &fs.Config.ExpectContinueTimeout, "expect-continue-timeout", "", fs.Config.ExpectContinueTimeout, "Timeout when using expect / 100-continue in HTTP")flags.BoolVarP(flagSet, &dumpHeaders, "dump-headers", "", false, "Dump HTTP headers - may contain sensitive info")flags.BoolVarP(flagSet, &dumpBodies, "dump-bodies", "", false, "Dump HTTP headers and bodies - may contain sensitive info")flags.BoolVarP(flagSet, &fs.Config.InsecureSkipVerify, "no-check-certificate", "", fs.Config.InsecureSkipVerify, "Do not verify the server SSL certificate. Insecure.")diff --git a/fs/fshttp/http.go b/fs/fshttp/http.goindex db1face8b..1414426be 100644--- a/fs/fshttp/http.go+++ b/fs/fshttp/http.go@@ -178,7 +178,7 @@ func NewTransportCustom(ci *fs.ConfigInfo, customize func(*http.Transport)) httpreturn dialContextTimeout(ctx, network, addr, ci)}t.IdleConnTimeout = 60 * time.Second- t.ExpectContinueTimeout = ci.ConnectTimeout+ t.ExpectContinueTimeout = ci.ExpectContinueTimeout// customize the transport if requiredif customize != nil {