mirror of
https://github.com/rclone/rclone.git
synced 2024-12-23 07:29:35 +01:00
onedrive: Fix socket leak in multipart session upload
This had gone unnoticed until recently when we changed to uploading all files with a multipart session.
This commit is contained in:
parent
4d553ef701
commit
9df266a6b4
@ -1125,12 +1125,14 @@ func (o *Object) uploadFragment(url string, start int64, totalSize int64, chunk
|
||||
err = o.fs.pacer.Call(func() (bool, error) {
|
||||
_, _ = chunk.Seek(0, 0)
|
||||
resp, err = o.fs.srv.Call(&opts)
|
||||
if resp != nil {
|
||||
defer fs.CheckClose(resp.Body, &err)
|
||||
}
|
||||
retry, err := shouldRetry(resp, err)
|
||||
if !retry && resp != nil {
|
||||
if resp.StatusCode == 200 || resp.StatusCode == 201 {
|
||||
// we are done :)
|
||||
// read the item
|
||||
defer fs.CheckClose(resp.Body, &err)
|
||||
info = &api.Item{}
|
||||
return false, json.NewDecoder(resp.Body).Decode(info)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user