Skip to content

Commit 2c06d52

Browse files
authored
Merge pull request #100 from agin719/cos-v4-dev
update upload
2 parents 5172396 + c403391 commit 2c06d52

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

cos.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222

2323
const (
2424
// Version current go sdk version
25-
Version = "0.7.17"
25+
Version = "0.7.18"
2626
userAgent = "cos-go-sdk-v5/" + Version
2727
contentTypeXML = "application/xml"
2828
defaultServiceBaseURL = "http://service.cos.myqcloud.com"

helper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func decodeURIComponent(s string) (string, error) {
113113
}
114114

115115
func DecodeURIComponent(s string) (string, error) {
116-
return DecodeURIComponent(s)
116+
return decodeURIComponent(s)
117117
}
118118

119119
func EncodeURIComponent(s string) string {

object.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,12 +563,12 @@ func worker(s *ObjectService, jobs <-chan *Jobs, results chan<- *Results) {
563563
results <- &res
564564
}
565565

566-
fd.Seek(j.Chunk.OffSet, os.SEEK_SET)
567566
// UploadPart do not support the chunk trsf, so need to add the content-length
568567
j.Opt.ContentLength = int(j.Chunk.Size)
569568

570569
rt := j.RetryTimes
571570
for {
571+
fd.Seek(j.Chunk.OffSet, os.SEEK_SET)
572572
resp, err := s.UploadPart(context.Background(), j.Name, j.UploadId, j.Chunk.Number,
573573
&io.LimitedReader{R: fd, N: j.Chunk.Size}, j.Opt)
574574
res.PartNumber = j.Chunk.Number

0 commit comments

Comments
 (0)