From 8902da39f2bf2e5f28b4648d2e4cf504e419ebbd Mon Sep 17 00:00:00 2001 From: Kenneth Hsu Date: Sat, 29 Sep 2018 10:36:32 -0700 Subject: [PATCH] Undo removal of method parameters. This should be done on a separate branch for a different pull request. --- Duplicati/Library/Main/BackendManager.cs | 4 ++-- Duplicati/Library/Utility/DirectStreamLink.cs | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Duplicati/Library/Main/BackendManager.cs b/Duplicati/Library/Main/BackendManager.cs index 9c628b340..49e00f44d 100644 --- a/Duplicati/Library/Main/BackendManager.cs +++ b/Duplicati/Library/Main/BackendManager.cs @@ -272,7 +272,7 @@ namespace Duplicati.Library.Main public string Newname; } - public DatabaseCollector(LocalDatabase database) + public DatabaseCollector(LocalDatabase database, IBackendWriter stats) { m_database = database; m_dbqueue = new List(); @@ -376,7 +376,7 @@ namespace Duplicati.Library.Main m_numberofretries = options.NumberOfRetries; m_retrydelay = options.RetryDelay; - m_db = new DatabaseCollector(database); + m_db = new DatabaseCollector(database, statwriter); m_backend = DynamicLoader.BackendLoader.GetBackend(m_backendurl, m_options.RawOptions); if (m_backend == null) diff --git a/Duplicati/Library/Utility/DirectStreamLink.cs b/Duplicati/Library/Utility/DirectStreamLink.cs index 89e330463..5c51d97ef 100644 --- a/Duplicati/Library/Utility/DirectStreamLink.cs +++ b/Duplicati/Library/Utility/DirectStreamLink.cs @@ -399,6 +399,9 @@ namespace Duplicati.Library.Utility /// public class DataPump { + /// Default buffer size for pumping + public const int DEFAULTBUFSIZE = 1 << 14; // 16K + private readonly bool m_closeInputWhenDone, m_closeOutputWhenDone; private readonly Action m_callbackFinalizePumping = null; private Stream m_input, m_output; @@ -412,7 +415,7 @@ namespace Duplicati.Library.Utility /// A callback to issue when pumping is done but before streams are closed. e.g. Can add data to output. /// Disable auto close of input stream when pumping is done. /// Disable auto close of output stream when pumping is done. - public DataPump(Stream input, Stream output + public DataPump(Stream input, Stream output, int bufsize = DEFAULTBUFSIZE , Action callbackFinalizePumping = null , bool dontCloseInputWhenDone = false, bool dontCloseOutputWhenDone = false) {