fix typo
Signed-off-by: Christian Richter <crichter@owncloud.com>
This commit is contained in:
parent
88b0263bb8
commit
49543518f0
1 changed files with 5 additions and 5 deletions
|
@ -54,7 +54,7 @@ func (f *Fs) shouldRetryChunk(ctx context.Context, resp *http.Response, err erro
|
||||||
return f.shouldRetry(ctx, resp, err)
|
return f.shouldRetry(ctx, resp, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *Uploader) uploadChunck(ctx context.Context, body io.Reader, size int64, offset int64, options ...fs.OpenOption) (int64, error) {
|
func (u *Uploader) uploadChunk(ctx context.Context, body io.Reader, size int64, offset int64, options ...fs.OpenOption) (int64, error) {
|
||||||
var method string
|
var method string
|
||||||
|
|
||||||
if !u.overridePatchMethod {
|
if !u.overridePatchMethod {
|
||||||
|
@ -110,7 +110,7 @@ func (u *Uploader) Upload(ctx context.Context, options ...fs.OpenOption) error {
|
||||||
|
|
||||||
fs.Debug(u.fs, "Uploaded starts")
|
fs.Debug(u.fs, "Uploaded starts")
|
||||||
for u.offset < u.upload.size && !u.aborted {
|
for u.offset < u.upload.size && !u.aborted {
|
||||||
err := u.UploadChunck(ctx, cnt, options...)
|
err := u.UploadChunk(ctx, cnt, options...)
|
||||||
cnt++
|
cnt++
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -121,8 +121,8 @@ func (u *Uploader) Upload(ctx context.Context, options ...fs.OpenOption) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// UploadChunck uploads a single chunck.
|
// UploadChunk uploads a single chunk.
|
||||||
func (u *Uploader) UploadChunck(ctx context.Context, cnt int, options ...fs.OpenOption) error {
|
func (u *Uploader) UploadChunk(ctx context.Context, cnt int, options ...fs.OpenOption) error {
|
||||||
chunkSize := u.fs.opt.ChunkSize
|
chunkSize := u.fs.opt.ChunkSize
|
||||||
data := make([]byte, chunkSize)
|
data := make([]byte, chunkSize)
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ func (u *Uploader) UploadChunck(ctx context.Context, cnt int, options ...fs.Open
|
||||||
|
|
||||||
body := bytes.NewBuffer(data[:size])
|
body := bytes.NewBuffer(data[:size])
|
||||||
|
|
||||||
newOffset, err := u.uploadChunck(ctx, body, int64(size), u.offset, options...)
|
newOffset, err := u.uploadChunk(ctx, body, int64(size), u.offset, options...)
|
||||||
|
|
||||||
if err == nil {
|
if err == nil {
|
||||||
fs.Debugf(u.fs, "Uploaded chunk no %d ok, range %d -> %d", cnt, u.offset, newOffset)
|
fs.Debugf(u.fs, "Uploaded chunk no %d ok, range %d -> %d", cnt, u.offset, newOffset)
|
||||||
|
|
Loading…
Reference in a new issue