"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
ftp: fix lockup on failed upload when using concurrency limit #3984
Nick Craig-Woode8eb658ba5b2
diff --git a/backend/ftp/ftp.go b/backend/ftp/ftp.goindex 58bd8cab6..a818dd87b 100644--- a/backend/ftp/ftp.go+++ b/backend/ftp/ftp.go@@ -207,7 +207,13 @@ func (f *Fs) putFtpConnection(pc **ftp.ServerConn, err error) {if f.opt.Concurrency > 0 {defer f.tokens.Put()}+ if pc == nil {+ return+ }c := *pc+ if c == nil {+ return+ }*pc = nilif err != nil {// If not a regular FTP error code then check the connection@@ -861,6 +867,7 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, opif err != nil {_ = c.Quit() // toss this connection to avoid sync errorsremove()+ o.fs.putFtpConnection(nil, err)return errors.Wrap(err, "update stor")}o.fs.putFtpConnection(&c, nil)