accounting: fix panic due to server-side copy fallback

This commit is contained in:
Ivan Andreev
2019-09-13 20:08:01 +03:00
committed by Nick Craig-Wood
parent 661dc568f3
commit d98d1be3fe
2 changed files with 17 additions and 0 deletions

View File

@@ -312,6 +312,9 @@ func Copy(ctx context.Context, f fs.Fs, dst fs.Object, remote string, src fs.Obj
} else {
_ = in.Close()
}
if err == fs.ErrorCantCopy {
tr.Reset() // skip incomplete accounting - will be overwritten by the manual copy below
}
} else {
err = fs.ErrorCantCopy
}