Skip to content

Commit

Permalink
update partcopy
Browse files Browse the repository at this point in the history
  • Loading branch information
jojoliang committed Sep 2, 2022
1 parent 6f08b8b commit f99b506
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cos.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ func (c *Client) doAPI(ctx context.Context, req *http.Request, result interface{

if result != nil {
if w, ok := result.(io.Writer); ok {
_, err = io.Copy(w, resp.Body)
io.Copy(w, resp.Body)
} else {
err = xml.NewDecoder(resp.Body).Decode(result)
if err == io.EOF {
Expand Down
2 changes: 1 addition & 1 deletion object_part.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ func (s *ObjectService) CopyPart(ctx context.Context, name, uploadID string, par
optHeader: opt,
result: &bs,
}
resp, err := s.client.send(ctx, &sendOpt)
resp, err := s.client.doRetry(ctx, &sendOpt)

if err == nil { // 请求正常
err = xml.Unmarshal(bs.Bytes(), &res) // body 正常返回
Expand Down

0 comments on commit f99b506

Please sign in to comment.