mirror of
https://github.com/rclone/rclone.git
synced 2025-12-11 22:14:05 +01:00
fs/accounting: Fix "file already closed" on transfer retries
This was caused by the recent reworking of the accounting interface. The Transfer object was recycling the Accounting object without resetting the stream. See: https://forum.rclone.org/t/error-file-already-closed/11469/ See: https://forum.rclone.org/t/rclone-b2-sync-post-error-method-not-supported/11718/
This commit is contained in:
@@ -117,6 +117,8 @@ func (tr *Transfer) Account(in io.ReadCloser) *Account {
|
||||
tr.mu.Lock()
|
||||
if tr.acc == nil {
|
||||
tr.acc = newAccountSizeName(tr.stats, in, tr.size, tr.remote)
|
||||
} else {
|
||||
tr.acc.UpdateReader(in)
|
||||
}
|
||||
tr.mu.Unlock()
|
||||
return tr.acc
|
||||
|
||||
Reference in New Issue
Block a user