Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/duplicati/duplicati.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Skovhede <kenneth@hexad.dk>2014-11-10 20:38:18 +0300
committerKenneth Skovhede <kenneth@hexad.dk>2014-11-10 20:38:18 +0300
commit86abc7565ab502d380b91250ca3e709149c98403 (patch)
tree9df5bb61e535c68f0e55fa7ef6c2d405373ef3cf /Duplicati/Library/Backend/WEBDAV
parentdf9f91d8deb1a987eff2c827b9ee8c49ffcb1914 (diff)
Added locally allocated buffers for copystream to reduce pressure on allocator
Diffstat (limited to 'Duplicati/Library/Backend/WEBDAV')
-rw-r--r--Duplicati/Library/Backend/WEBDAV/WEBDAV.cs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Duplicati/Library/Backend/WEBDAV/WEBDAV.cs b/Duplicati/Library/Backend/WEBDAV/WEBDAV.cs
index 4828294b7..f4a67314f 100644
--- a/Duplicati/Library/Backend/WEBDAV/WEBDAV.cs
+++ b/Duplicati/Library/Backend/WEBDAV/WEBDAV.cs
@@ -37,6 +37,7 @@ namespace Duplicati.Library.Backend
private bool m_forceDigestAuthentication = false;
private bool m_useSSL = false;
private string m_debugPropfindFile = null;
+ private readonly byte[] m_copybuffer = new byte[Duplicati.Library.Utility.Utility.DEFAULT_BUFFER_SIZE];
/// <summary>
/// A list of files seen in the last List operation.
@@ -149,7 +150,7 @@ namespace Duplicati.Library.Backend
if (!string.IsNullOrEmpty(m_debugPropfindFile))
{
using (System.IO.FileStream fs = new System.IO.FileStream(m_debugPropfindFile, System.IO.FileMode.Create, System.IO.FileAccess.Write, System.IO.FileShare.None))
- Utility.Utility.CopyStream(areq.GetResponseStream(), fs, false);
+ Utility.Utility.CopyStream(areq.GetResponseStream(), fs, false, m_copybuffer);
doc.Load(m_debugPropfindFile);
}
@@ -354,7 +355,7 @@ namespace Duplicati.Library.Backend
Utility.AsyncHttpRequest areq = new Utility.AsyncHttpRequest(req);
using (System.IO.Stream s = areq.GetRequestStream())
- Utility.Utility.CopyStream(stream, s);
+ Utility.Utility.CopyStream(stream, s, true, m_copybuffer);
using (System.Net.HttpWebResponse resp = (System.Net.HttpWebResponse)areq.GetResponse())
{
@@ -389,7 +390,7 @@ namespace Duplicati.Library.Backend
throw new System.Net.WebException(resp.StatusDescription, null, System.Net.WebExceptionStatus.ProtocolError, resp);
using (System.IO.Stream s = areq.GetResponseStream())
- Utility.Utility.CopyStream(s, stream);
+ Utility.Utility.CopyStream(s, stream, true, m_copybuffer);
}
}
catch (System.Net.WebException wex)