Set default to 32kb

This commit is contained in:
Ben Sarmiento
2024-04-28 19:45:10 +02:00
parent d55e5ac7d3
commit be1d22fed6
2 changed files with 3 additions and 4 deletions

View File

@@ -144,7 +144,7 @@ func (z *ZurgConfig) GetOnLibraryUpdate() string {
func (z *ZurgConfig) GetNetworkBufferSize() int { func (z *ZurgConfig) GetNetworkBufferSize() int {
if z.NetworkBufferSize == 0 { if z.NetworkBufferSize == 0 {
return 1024 * 1024 * 4 // 4MB return 32 * 1024 // 32kb
} }
return z.NetworkBufferSize return z.NetworkBufferSize
} }

View File

@@ -198,9 +198,8 @@ func (dl *Downloader) streamFileToResponse(
// log.Debugf("Serving file %s%s", unrestrict.Download, rangeLog) // log.Debugf("Serving file %s%s", unrestrict.Download, rangeLog)
// buf := make([]byte, cfg.GetNetworkBufferSize()) buf := make([]byte, cfg.GetNetworkBufferSize())
// io.CopyBuffer(resp, downloadResp.Body, buf) io.CopyBuffer(resp, downloadResp.Body, buf)
io.Copy(resp, downloadResp.Body)
} }
func redirect(resp http.ResponseWriter, req *http.Request, url string) { func redirect(resp http.ResponseWriter, req *http.Request, url string) {