update upload
This commit is contained in:
2
cos.go
2
cos.go
@@ -22,7 +22,7 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
// Version current go sdk version
|
// Version current go sdk version
|
||||||
Version = "0.7.17"
|
Version = "0.7.18"
|
||||||
userAgent = "cos-go-sdk-v5/" + Version
|
userAgent = "cos-go-sdk-v5/" + Version
|
||||||
contentTypeXML = "application/xml"
|
contentTypeXML = "application/xml"
|
||||||
defaultServiceBaseURL = "http://service.cos.myqcloud.com"
|
defaultServiceBaseURL = "http://service.cos.myqcloud.com"
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ func decodeURIComponent(s string) (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func DecodeURIComponent(s string) (string, error) {
|
func DecodeURIComponent(s string) (string, error) {
|
||||||
return DecodeURIComponent(s)
|
return decodeURIComponent(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
func EncodeURIComponent(s string) string {
|
func EncodeURIComponent(s string) string {
|
||||||
|
|||||||
@@ -563,12 +563,12 @@ func worker(s *ObjectService, jobs <-chan *Jobs, results chan<- *Results) {
|
|||||||
results <- &res
|
results <- &res
|
||||||
}
|
}
|
||||||
|
|
||||||
fd.Seek(j.Chunk.OffSet, os.SEEK_SET)
|
|
||||||
// UploadPart do not support the chunk trsf, so need to add the content-length
|
// UploadPart do not support the chunk trsf, so need to add the content-length
|
||||||
j.Opt.ContentLength = int(j.Chunk.Size)
|
j.Opt.ContentLength = int(j.Chunk.Size)
|
||||||
|
|
||||||
rt := j.RetryTimes
|
rt := j.RetryTimes
|
||||||
for {
|
for {
|
||||||
|
fd.Seek(j.Chunk.OffSet, os.SEEK_SET)
|
||||||
resp, err := s.UploadPart(context.Background(), j.Name, j.UploadId, j.Chunk.Number,
|
resp, err := s.UploadPart(context.Background(), j.Name, j.UploadId, j.Chunk.Number,
|
||||||
&io.LimitedReader{R: fd, N: j.Chunk.Size}, j.Opt)
|
&io.LimitedReader{R: fd, N: j.Chunk.Size}, j.Opt)
|
||||||
res.PartNumber = j.Chunk.Number
|
res.PartNumber = j.Chunk.Number
|
||||||
|
|||||||
Reference in New Issue
Block a user