diff options
author | warwickmm <warwickmm@users.noreply.github.com> | 2020-03-05 09:48:31 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-05 09:48:31 +0300 |
commit | c86ca0f38c7edc945e69d291afd63c3eb6d51ee4 (patch) | |
tree | dda7139ea3e419b0ae2a024158979cf052ac139d | |
parent | b1d1972cb8531b9c100581b5eaeb3cd5a81f4b97 (diff) | |
parent | 9739517b0a9d35d1631e448dd994d3d64b3b00e7 (diff) |
Merge pull request #4127 from seantempleton/throttleconfusion
Fix bandwidth throttling inconsistency
-rw-r--r-- | Duplicati/Library/Main/BackendManager.cs | 6 | ||||
-rw-r--r-- | Duplicati/Library/Main/Operation/Common/BackendHandler.cs | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Duplicati/Library/Main/BackendManager.cs b/Duplicati/Library/Main/BackendManager.cs index 67e28976d..0523ccccd 100644 --- a/Duplicati/Library/Main/BackendManager.cs +++ b/Duplicati/Library/Main/BackendManager.cs @@ -720,7 +720,7 @@ namespace Duplicati.Library.Main if (m_backend is Library.Interface.IStreamingBackend && !m_options.DisableStreamingTransfers)
{
using (var fs = System.IO.File.OpenRead(item.LocalFilename))
- using (var ts = new ThrottledStream(fs, m_options.MaxUploadPrSecond, m_options.MaxDownloadPrSecond))
+ using (var ts = new ThrottledStream(fs, m_options.MaxUploadPrSecond, 0))
using (var pgs = new Library.Utility.ProgressReportingStream(ts, pg => HandleProgress(ts, pg)))
((Library.Interface.IStreamingBackend)m_backend).PutAsync(item.RemoteFilename, pgs, CancellationToken.None).Wait();
}
@@ -814,7 +814,7 @@ namespace Duplicati.Library.Main {
using (var ss = new ShaderStream(nextTierWriter, false))
{
- using (var ts = new ThrottledStream(ss, m_options.MaxDownloadPrSecond, m_options.MaxUploadPrSecond))
+ using (var ts = new ThrottledStream(ss, 0, m_options.MaxDownloadPrSecond))
using (var pgs = new Library.Utility.ProgressReportingStream(ts, pg => HandleProgress(ts, pg)))
{
taskHasher.Start(); // We do not start tasks earlier to be sure the input always gets closed.
@@ -900,7 +900,7 @@ namespace Duplicati.Library.Main using (var hs = GetFileHasherStream(fs, System.Security.Cryptography.CryptoStreamMode.Write, out getFileHash))
using (var ss = new ShaderStream(hs, true))
{
- using (var ts = new ThrottledStream(ss, m_options.MaxDownloadPrSecond, m_options.MaxUploadPrSecond))
+ using (var ts = new ThrottledStream(ss, 0, m_options.MaxDownloadPrSecond))
using (var pgs = new Library.Utility.ProgressReportingStream(ts, pg => HandleProgress(ts, pg)))
{ ((Library.Interface.IStreamingBackend)m_backend).Get(item.RemoteFilename, pgs); }
ss.Flush();
diff --git a/Duplicati/Library/Main/Operation/Common/BackendHandler.cs b/Duplicati/Library/Main/Operation/Common/BackendHandler.cs index 62b90d859..f09ad133e 100644 --- a/Duplicati/Library/Main/Operation/Common/BackendHandler.cs +++ b/Duplicati/Library/Main/Operation/Common/BackendHandler.cs @@ -451,7 +451,7 @@ namespace Duplicati.Library.Main.Operation.Common if (m_backend is Library.Interface.IStreamingBackend && !m_options.DisableStreamingTransfers)
{
using (var fs = System.IO.File.OpenWrite(tmpfile))
- using (var ts = new ThrottledStream(fs, m_options.MaxUploadPrSecond, m_options.MaxDownloadPrSecond))
+ using (var ts = new ThrottledStream(fs, 0, m_options.MaxDownloadPrSecond))
using (var pgs = new Library.Utility.ProgressReportingStream(ts, pg => HandleProgress(ts, pg)))
((Library.Interface.IStreamingBackend)m_backend).Get(item.RemoteFilename, pgs);
}
|