From c40339150975dcc3ba5b31c7fd501c2a15004127 Mon Sep 17 00:00:00 2001 From: jojoliang Date: Mon, 11 Jan 2021 21:28:49 +0800 Subject: [PATCH] update upload --- cos.go | 2 +- helper.go | 2 +- object.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cos.go b/cos.go index 2f5dacf..a6596e8 100644 --- a/cos.go +++ b/cos.go @@ -22,7 +22,7 @@ import ( const ( // Version current go sdk version - Version = "0.7.17" + Version = "0.7.18" userAgent = "cos-go-sdk-v5/" + Version contentTypeXML = "application/xml" defaultServiceBaseURL = "http://service.cos.myqcloud.com" diff --git a/helper.go b/helper.go index 5aef708..05d8e2b 100644 --- a/helper.go +++ b/helper.go @@ -113,7 +113,7 @@ func decodeURIComponent(s string) (string, error) { } func DecodeURIComponent(s string) (string, error) { - return DecodeURIComponent(s) + return decodeURIComponent(s) } func EncodeURIComponent(s string) string { diff --git a/object.go b/object.go index 71b60af..e9b07cb 100644 --- a/object.go +++ b/object.go @@ -563,12 +563,12 @@ func worker(s *ObjectService, jobs <-chan *Jobs, results chan<- *Results) { results <- &res } - fd.Seek(j.Chunk.OffSet, os.SEEK_SET) // UploadPart do not support the chunk trsf, so need to add the content-length j.Opt.ContentLength = int(j.Chunk.Size) rt := j.RetryTimes for { + fd.Seek(j.Chunk.OffSet, os.SEEK_SET) resp, err := s.UploadPart(context.Background(), j.Name, j.UploadId, j.Chunk.Number, &io.LimitedReader{R: fd, N: j.Chunk.Size}, j.Opt) res.PartNumber = j.Chunk.Number