From 1e41a015b5bcce912625880f07c8e43f02318942 Mon Sep 17 00:00:00 2001 From: Stefan Breunig Date: Thu, 17 Nov 2016 21:54:40 +0100 Subject: [PATCH] just use one upload method, as go-acd can determine size itself now Fixes #874 Fixes #669 --- amazonclouddrive/amazonclouddrive.go | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/amazonclouddrive/amazonclouddrive.go b/amazonclouddrive/amazonclouddrive.go index 2a4d1a9f0..0ddd385d3 100644 --- a/amazonclouddrive/amazonclouddrive.go +++ b/amazonclouddrive/amazonclouddrive.go @@ -590,11 +590,7 @@ func (f *Fs) Put(in io.Reader, src fs.ObjectInfo) (fs.Object, error) { err = f.pacer.CallNoRetry(func() (bool, error) { start := time.Now() f.startUpload() - if src.Size() != 0 { - info, resp, err = folder.Put(in, leaf) - } else { - info, resp, err = folder.PutSized(in, size, leaf) - } + info, resp, err = folder.Put(in, leaf) f.stopUpload() var ok bool ok, info, err = f.checkUpload(resp, in, src, info, err, time.Since(start)) @@ -913,7 +909,6 @@ func (o *Object) Open(options ...fs.OpenOption) (in io.ReadCloser, err error) { // // The new object may have been created if an error is returned func (o *Object) Update(in io.Reader, src fs.ObjectInfo) error { - size := src.Size() file := acd.File{Node: o.info} var info *acd.File var resp *http.Response @@ -921,11 +916,7 @@ func (o *Object) Update(in io.Reader, src fs.ObjectInfo) error { err = o.fs.pacer.CallNoRetry(func() (bool, error) { start := time.Now() o.fs.startUpload() - if size != 0 { - info, resp, err = file.Overwrite(in) - } else { - info, resp, err = file.OverwriteSized(in, size) - } + info, resp, err = file.Overwrite(in) o.fs.stopUpload() var ok bool ok, info, err = o.fs.checkUpload(resp, in, src, info, err, time.Since(start))