Bump all dependencies

This commit is contained in:
Matthew Penner
2020-12-27 11:49:08 -07:00
parent ddb683efb6
commit a4c8b8714b
13 changed files with 282 additions and 160 deletions

View File

@@ -397,11 +397,13 @@ func postTransfer(c *gin.Context) {
}
}(progress, ticker)
var reader io.Reader = res.Body
var reader io.Reader
downloadLimit := float64(config.Get().System.Transfers.DownloadLimit) * 1024 * 1024
if downloadLimit > 0 {
// Wrap the body with a reader that is limited to the defined download limit speed.
reader = ratelimit.Reader(res.Body, ratelimit.NewBucketWithRate(downloadLimit, int64(downloadLimit)))
} else {
reader = res.Body
}
buf := make([]byte, 1024*4)