"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
operations: fix oversized getfile tail requests
唐僧洗发用飘柔3ca4fd99b6de
diff --git a/fs/operations/rc.go b/fs/operations/rc.goindex 11b229d6f..59501466a 100644--- a/fs/operations/rc.go+++ b/fs/operations/rc.go@@ -1216,6 +1216,9 @@ func rcGetFile(ctx context.Context, in rc.Params) (out rc.Params, err error) {start := offsetif start < 0 {start += size+ if start < 0 {+ start = 0+ }}if start > size {start = sizediff --git a/fs/operations/rc_test.go b/fs/operations/rc_test.goindex 038b4f082..802071d5b 100644--- a/fs/operations/rc_test.go+++ b/fs/operations/rc_test.go@@ -979,6 +979,16 @@ func TestRcGetFile(t *testing.T) {require.NoError(t, err)assert.Equal(t, "Operation!", out["result"])+ // A suffix longer than the file represents the whole file.+ in = rc.Params{+ "fs": r.FremoteName,+ "remote": file1.Path,+ "tail": int64(operations.DefaultGetFileMaxSize + 1),+ }+ out, err = call.Fn(ctx, in)+ require.NoError(t, err)+ assert.Equal(t, file1Contents, out["result"])+// 6. Negative offsetin = rc.Params{"fs": r.FremoteName,