Commit Graph
22 Commits
Author SHA1 Message Date
Kenneth Skovhede a0c0cbf3d5 Removed mentions of Mono in code, and fixed some entry paths pointing to the dll instead of the exe 2024-04-15 13:20:39 +02:00
Kenneth Skovhede 473c6cbbb8 Merge commit '4f577c65a4d8806f79637c50c21ca3a683c5a07a' into feature/kestrel-avalonia-upgrade 2024-03-04 12:21:53 +01:00
Kenneth Skovhede 5c1d6bda76 Fixes for OAuth 2024-03-01 14:30:28 +01:00
Kenneth Skovhede 40dd3c6816 Updated all license mentions to MIT 2024-02-28 15:45:30 +01:00
Thomas Suckow d528703fe7 Merge branch 'master' into experiment/net5-split
# Conflicts:
#	.github/workflows/tests.yml
#	Duplicati.sln
#	Duplicati/CommandLine/BackendTester/Duplicati.CommandLine.BackendTester.csproj
#	Duplicati/CommandLine/BackendTool/Duplicati.CommandLine.BackendTool.csproj
#	Duplicati/CommandLine/Duplicati.CommandLine.csproj
#	Duplicati/CommandLine/RecoveryTool/Duplicati.CommandLine.RecoveryTool.csproj
#	Duplicati/GUI/Duplicati.GUI.TrayIcon/Duplicati.GUI.TrayIcon.csproj
#	Duplicati/Library/Backend/AzureBlob/AzureBlobWrapper.cs
#	Duplicati/Library/Backend/Mega/Duplicati.Library.Backend.Mega.csproj
#	Duplicati/Library/Backend/Mega/packages.config
#	Duplicati/Library/Backend/OAuthHelper/Duplicati.Library.OAuthHelper.csproj
#	Duplicati/Library/Backend/Tardigrade/Duplicati.Library.Backend.Tardigrade.csproj
#	Duplicati/Library/Backend/Tardigrade/Properties/AssemblyInfo.cs
#	Duplicati/Library/Backend/Tardigrade/packages.config
#	Duplicati/Library/Common/Duplicati.Library.Common.csproj
#	Duplicati/Library/Common/IO/SystemIOWindows.cs
#	Duplicati/Library/Modules/Builtin/Duplicati.Library.Modules.Builtin.csproj
#	Duplicati/Library/Modules/Builtin/packages.config
#	Duplicati/Library/Utility/Utility.cs
#	Duplicati/License/Duplicati.License.csproj
#	Duplicati/Server/Duplicati.Server.csproj
#	Duplicati/Server/packages.config
#	Duplicati/UnitTest/Duplicati.UnitTest.csproj
2022-02-22 19:04:01 -08:00
Tyler Gill 1ec1e18634 OAuthHttpClient should behave the same as the WebRequest code path and treat no http-operation-timeout override as meaning to use an infinite timeout. 2021-03-22 10:47:25 -06:00
Max c882953fdd upstream 2020-05-31 13:50:13 +02:00
Kenneth Hsu 21d0247e6d Throw TimeoutException when an HTTP timeout occurs.
The HttpClient.GetAsync method throws an OperationCanceledException when
the timeout is exceeded.  In order to provide a more informative
exception, we will detect this case and throw a TimeoutException
instead.

This is related to issue #3772.
2020-03-05 12:00:23 -08:00
Max 41a5591532 upstream 2019-12-25 16:34:56 +01:00
Tyler Gill 7012c49b8f Support BufferRequests in HttpClient based backends 2019-10-22 15:55:11 -06:00
Kenneth Hsu 31a89f142a Add workaround for bug in Mono HttpClient.
There is a regression in Mono 6.0 where an HttpClient with a BaseAddress
cannot make requests to URLs that begin with '/'.

This addresses issue #3852.
2019-09-08 19:34:12 -07:00
Max 7aea21ef35 upstream 2019-07-28 12:44:20 +02:00
Kenneth Hsu 51e0298597 Remove unused variable that caused compiler warning. 2019-07-07 10:15:13 -07:00
Kenneth Hsu a30f578071 Rename method parameter. 2019-05-26 15:14:42 -07:00
Kenneth Hsu 6b04625cea Add XML comment for method parameter. 2019-05-26 15:09:24 -07:00
Kenneth Hsu fe5e17a3fa Throw TimeoutException upon HTTP timeout.
The HttpClient.SendAsync method throws an OperationCanceledException
when the timeout is exceeded.  In order to provide a more informative
exception, we will detect this case and throw a TimeoutException
instead.  This will also allow the BackendUploader to differentiate
between cancellations requested by the user and those generated by
an HTTP timeout.

Previously, a ThreadAbortException or OperationCanceledException would
be rethrown in the BackendUploader.DoWithRetry method.  However, the
modifications made in revision 61f511c087
from pull request #3684 appear to have let this case slip through.

See the following links for more information:

https://stackoverflow.com/questions/10547895/how-can-i-tell-when-httpclient-has-timed-out
https://thomaslevesque.com/2018/02/25/better-timeout-handling-with-httpclient

This addresses issue #3772.
2019-05-26 14:57:05 -07:00
Kenneth Hsu 988c445233 Provide cancellation token to async methods. 2019-05-26 14:55:31 -07:00
Max e2e1ddc151 upstream 2018-06-29 17:26:53 +02:00
Max 6289530f08 backend oauth TODO 2018-06-24 13:29:01 +02:00
Kenneth Hsu 54c4f9224d Allow tasks to complete on any thread when context is irrelevant.
When the code following the await can be executed on any thread, it's
recommended to use ConfigureAwait(false) to avoid unnecessary context
switching and potential deadlocks.
2018-06-21 19:28:27 -07:00
Tyler Gill 5be38df560 Fix typo in OAuthHttpClient 2018-06-04 14:59:58 -06:00
Tyler Gill f93f9dcc5a Add new utility class, OAuthHttpClient.
This class extends HttpClient and uses an OAuthHttpMessageHandler under the covers to automatically authenticate requests.
Additionally, it automatically respects the global HttpContextSettings for overall timeout, read/write timeout, and SSL certificate validation.
(BufferRequests isn't currently handled, as HttpClient doesn't seem to easily expose that flag, and as of .NET 4.5, seems to not buffer by default.)
2018-03-23 15:07:51 -06:00