diff --git a/CHANGELOG.md b/CHANGELOG.md index 3fe21e8..afc3d2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.0.65] - 2024-04-07 +### Added +- Added option to configure the buffersize for the internal downloader. + ## [2.0.64] - 2024-04-06 ### Added - Add log level Verbose and add logging for the internal downloader, only works when both log levels are set to Verbose. diff --git a/server/RdtClient.Data/Models/Internal/DbSettings.cs b/server/RdtClient.Data/Models/Internal/DbSettings.cs index 2a39770..b58ca4e 100644 --- a/server/RdtClient.Data/Models/Internal/DbSettings.cs +++ b/server/RdtClient.Data/Models/Internal/DbSettings.cs @@ -103,6 +103,10 @@ public class DbSettingsDownloadClient [Description("Split the downloaded file in this amount of chunks.")] public Int32 ChunkCount { get; set; } = 8; + [DisplayName("Buffer Size")] + [Description("Buffersize in bytes for the internal downloader, used to read data and write it to disk.")] + public Int32 BufferSize { get; set; } = 1024 * 1024; + [DisplayName("Connection Timeout (only used for the Internal Downloader)")] [Description("Timeout in milliseconds before the downloader times out.")] public Int32 Timeout { get; set; } = 5000; diff --git a/server/RdtClient.Service/Services/Downloaders/InternalDownloader.cs b/server/RdtClient.Service/Services/Downloaders/InternalDownloader.cs index 5d791a1..98cc1ba 100644 --- a/server/RdtClient.Service/Services/Downloaders/InternalDownloader.cs +++ b/server/RdtClient.Service/Services/Downloaders/InternalDownloader.cs @@ -118,6 +118,13 @@ public class InternalDownloader : IDownloader private void SetSettings() { + var settingBufferSize = Settings.Get.DownloadClient.BufferSize; + + if (settingBufferSize <= 4096) + { + settingBufferSize = 4096; + } + var settingDownloadParallelCount = Settings.Get.DownloadClient.ParallelCount; if (settingDownloadParallelCount <= 0) @@ -141,6 +148,7 @@ public class InternalDownloader : IDownloader settingDownloadTimeout = 1000; } + _downloadConfiguration.BufferSize = settingBufferSize; _downloadConfiguration.LogLevel = (Int32)Settings.Get.DownloadClient.LogLevel; _downloadConfiguration.Parallel = settingDownloadParallelCount; _downloadConfiguration.MaximumBytesPerSecond = settingDownloadMaxSpeed;