mirror of
https://github.com/rclone/rclone.git
synced 2024-12-23 15:38:57 +01:00
acd: fix panic when renaming files - fixes #973
Fixed by no longer overwriting the parameters in a retry loop
This commit is contained in:
parent
45862f4c16
commit
aa62e93094
@ -1007,25 +1007,23 @@ func (o *Object) Remove() error {
|
||||
}
|
||||
|
||||
// Restore a node
|
||||
func (f *Fs) restoreNode(info *acd.Node) (*acd.Node, error) {
|
||||
func (f *Fs) restoreNode(info *acd.Node) (newInfo *acd.Node, err error) {
|
||||
var resp *http.Response
|
||||
var err error
|
||||
err = f.pacer.Call(func() (bool, error) {
|
||||
info, resp, err = info.Restore()
|
||||
newInfo, resp, err = info.Restore()
|
||||
return f.shouldRetry(resp, err)
|
||||
})
|
||||
return info, err
|
||||
return newInfo, err
|
||||
}
|
||||
|
||||
// Changes name of given node
|
||||
func (f *Fs) renameNode(info *acd.Node, newName string) (*acd.Node, error) {
|
||||
func (f *Fs) renameNode(info *acd.Node, newName string) (newInfo *acd.Node, err error) {
|
||||
var resp *http.Response
|
||||
var err error
|
||||
err = f.pacer.Call(func() (bool, error) {
|
||||
info, resp, err = info.Rename(newName)
|
||||
newInfo, resp, err = info.Rename(newName)
|
||||
return f.shouldRetry(resp, err)
|
||||
})
|
||||
return info, err
|
||||
return newInfo, err
|
||||
}
|
||||
|
||||
// Replaces one parent with another, effectively moving the file. Leaves other
|
||||
|
Loading…
Reference in New Issue
Block a user