"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
webdav: request only required properties in listAll to improve performance
ZRHan523a29a4e993
diff --git a/backend/webdav/webdav.go b/backend/webdav/webdav.goindex ccf48e957..d9a5cf0c7 100644--- a/backend/webdav/webdav.go+++ b/backend/webdav/webdav.go@@ -225,6 +225,7 @@ type Fs struct {hasOCMD5 bool // set if can use owncloud style checksums for MD5hasOCSHA1 bool // set if can use owncloud style checksums for SHA1hasMESHA1 bool // set if can use fastmail style checksums for SHA1+ useStandardProps bool // set if should use standard props for PROPFINDntlmAuthMu sync.Mutex // mutex to serialize NTLM auth roundtripschunksUploadURL string // upload URL for nextcloud chunkedcanChunk bool // set if nextcloud and nextcloud_chunk_size is set@@ -352,7 +353,10 @@ func (f *Fs) readMetaDataForPath(ctx context.Context, path string, depth string)}if f.hasOCMD5 || f.hasOCSHA1 {opts.Body = bytes.NewBuffer(owncloudProps)+ } else if f.useStandardProps {+ opts.Body = bytes.NewBuffer(standardProps)}+ // Note: According to WebDAV RFC 4918, empty PROPFIND body defaults to allpropvar result api.Multistatusvar resp *http.Responseerr = f.pacer.Call(func() (bool, error) {@@ -711,6 +715,7 @@ func (f *Fs) setQuirks(ctx context.Context, vendor string) error {f.precision = time.Secondf.useOCMtime = truecase "other":+ f.useStandardProps = truedefault:fs.Debugf(f, "Unknown vendor %q", vendor)}@@ -759,13 +764,23 @@ var owncloudProps = []byte(`<?xml version="1.0"?><d:getlastmodified /><d:getcontentlength /><d:resourcetype />- <d:getcontenttype /><oc:checksums /><oc:permissions /></d:prop></d:propfind>`)+var standardProps = []byte(`<?xml version="1.0"?>+<d:propfind xmlns:d="DAV:">+ <d:prop>+ <d:displayname/>+ <d:getlastmodified/>+ <d:getcontentlength/>+ <d:resourcetype/>+ </d:prop>+</d:propfind>+`)+// list the objects into the function supplied//// If directories is set it only sends directories@@ -787,7 +802,10 @@ func (f *Fs) listAll(ctx context.Context, dir string, directoriesOnly bool, file}if f.hasOCMD5 || f.hasOCSHA1 {opts.Body = bytes.NewBuffer(owncloudProps)+ } else if f.useStandardProps {+ opts.Body = bytes.NewBuffer(standardProps)}+ // Note: According to WebDAV RFC 4918, empty PROPFIND body defaults to `allprop`var result api.Multistatusvar resp *http.Responseerr = f.pacer.Call(func() (bool, error) {