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:
authorTyler Gill <tyler.gill@byu.net>2020-03-23 23:10:40 +0300
committerTyler Gill <tyler.gill@byu.net>2020-03-23 23:10:40 +0300
commite742205f65cdfd85953c178039b1eb2a9e4947e3 (patch)
treec02672c36dd9fd0638191e0aa4218658e2cc7ef0 /Duplicati/CommandLine
parent7679e9dee91a5a6331347449d8d1d8746001f337 (diff)
Add --use-http-client=false parameter to backends based on Microsoft Graph APIs (OneDrive v2, SharePoint v2, etc.) to make them use the OAuthHelper and HttpWebRequest infra used by most / all other backends for HTTP requests. This lives in parallel to the original implementation that uses the OAuthHttpClient class, but is intended to see if this prevents the memory leaks and problems seen in some versions of Mono when using the OneDrive v2 backend.
Diffstat (limited to 'Duplicati/CommandLine')
-rw-r--r--Duplicati/CommandLine/BackendTester/Program.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/Duplicati/CommandLine/BackendTester/Program.cs b/Duplicati/CommandLine/BackendTester/Program.cs
index 8515841a3..a56c131fd 100644
--- a/Duplicati/CommandLine/BackendTester/Program.cs
+++ b/Duplicati/CommandLine/BackendTester/Program.cs
@@ -394,6 +394,30 @@ namespace Duplicati.CommandLine.BackendTester
Console.WriteLine("*** Remote folder contains {0} after cleanup", fe.Name);
}
+ // Test some error cases
+ Console.WriteLine("Checking retrieval of non-existent file...");
+ bool caughtExpectedException = false;
+ try
+ {
+ using (Duplicati.Library.Utility.TempFile tempFile = new Duplicati.Library.Utility.TempFile())
+ {
+ backend.Get(string.Format("NonExistentFile-{0}", Guid.NewGuid()), tempFile.Name);
+ }
+ }
+ catch (FileMissingException ex)
+ {
+ Console.WriteLine("Caught expected FileMissingException");
+ caughtExpectedException = true;
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine("*** Retrieval of non-existent file failed: {0}", ex);
+ }
+
+ if (!caughtExpectedException)
+ {
+ Console.WriteLine("*** Retrieval of non-existent file should have failed with FileMissingException");
+ }
}
// Test quota retrieval