From 6bf0d2265c31a8b357d7bc2222786568e4c5642c Mon Sep 17 00:00:00 2001 From: Brandon High Date: Tue, 7 Apr 2020 22:07:41 -0700 Subject: [PATCH] Call ReadAll() on the body io.ReadCloser to allow the http keepalive connection to be reused. --- src/duplicacy_dropboxstorage.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/duplicacy_dropboxstorage.go b/src/duplicacy_dropboxstorage.go index 842b52b..b8545cd 100644 --- a/src/duplicacy_dropboxstorage.go +++ b/src/duplicacy_dropboxstorage.go @@ -6,6 +6,7 @@ package duplicacy import ( "fmt" + "io/ioutil" "strings" "github.com/gilbertchen/go-dropbox" @@ -199,6 +200,7 @@ func (storage *DropboxStorage) DownloadFile(threadIndex int, filePath string, ch } defer output.Body.Close() + defer ioutil.ReadAll(output.Body) _, err = RateLimitedCopy(chunk, output.Body, storage.DownloadRateLimit/len(storage.clients)) return err