mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-11-27 20:59:42 +08:00
upload_content: upload close response.Body
This commit is contained in:
parent
3d8b8ffced
commit
4a4ef3cc3c
@ -313,19 +313,20 @@ func upload_content(fillBufferFunction func(w io.Writer) error, originalDataSize
|
|||||||
}
|
}
|
||||||
// print("+")
|
// print("+")
|
||||||
resp, post_err := HttpClient.Do(req)
|
resp, post_err := HttpClient.Do(req)
|
||||||
|
defer util.CloseResponse(resp)
|
||||||
if post_err != nil {
|
if post_err != nil {
|
||||||
if strings.Contains(post_err.Error(), "connection reset by peer") ||
|
if strings.Contains(post_err.Error(), "connection reset by peer") ||
|
||||||
strings.Contains(post_err.Error(), "use of closed network connection") {
|
strings.Contains(post_err.Error(), "use of closed network connection") {
|
||||||
glog.V(1).Infof("repeat error upload request %s: %v", option.UploadUrl, postErr)
|
glog.V(1).Infof("repeat error upload request %s: %v", option.UploadUrl, postErr)
|
||||||
stats.FilerRequestCounter.WithLabelValues(stats.RepeatErrorUploadContent).Inc()
|
stats.FilerRequestCounter.WithLabelValues(stats.RepeatErrorUploadContent).Inc()
|
||||||
resp, post_err = HttpClient.Do(req)
|
resp, post_err = HttpClient.Do(req)
|
||||||
|
defer util.CloseResponse(resp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if post_err != nil {
|
if post_err != nil {
|
||||||
return nil, fmt.Errorf("upload %s %d bytes to %v: %v", option.Filename, originalDataSize, option.UploadUrl, post_err)
|
return nil, fmt.Errorf("upload %s %d bytes to %v: %v", option.Filename, originalDataSize, option.UploadUrl, post_err)
|
||||||
}
|
}
|
||||||
// print("-")
|
// print("-")
|
||||||
defer util.CloseResponse(resp)
|
|
||||||
|
|
||||||
var ret UploadResult
|
var ret UploadResult
|
||||||
etag := getEtag(resp)
|
etag := getEtag(resp)
|
||||||
|
Loading…
Reference in New Issue
Block a user