Browse Source

update upload

tags/v0.7.18^2
jojoliang 4 years ago
parent
commit
c403391509
  1. 2
      cos.go
  2. 2
      helper.go
  3. 2
      object.go

2
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"

2
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 {

2
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

Loading…
Cancel
Save