Commit Graph
98 Commits
Author SHA1 Message Date
Kenneth Skovhede 0f9669b273 Final conversion to async backends
This PR is the final change, where all backends are now purely implemented with async interfaces.

The code changes here replace the LIST call with an async version. This affect all backends (and then some) but the changes are mostly mechanical rewrites of the code.

In many places, the backeds were already prepared for async output, in other some glue was needed.

To reduce the scope of this change, some backends simply report a synchronous result as an async list.
2025-02-17 16:45:51 +01:00
Kenneth Skovhede bc8f6dd0c8 This adds the option to parse flags, where an enum can have multiple values.
It is only used by the FTP backend.
2025-01-30 10:52:17 +01:00
Kenneth SkovhedeandGitHub 6bbd64a655 Fixed nullability warnings in Utility.cs (#5861)
* Fixed nullability warnings in `Utility.cs`

* Fixed a number of nullability issues and warnings

* More nullable fixes

* Fixed the overwrite issue

* Fixed additional nullability issues

* Removed additional nullability issues

* More nullability fixes and added some xmldoc

* Added more xmldocs and removed an unused argument

* Removed more warnings
2025-01-14 14:03:48 +01:00
Kenneth SkovhedeandGitHub 9464caf622 Feature/update license 2025 (#5851)
* Fixed some minor whitespace issues

* Updated all copyright to 2025
2025-01-07 09:40:39 +01:00
Kenneth SkovhedeandGitHub 6fdb01b52a This commit ensures the client connects on first use, instead of relying on the library to connect. (#5828) 2025-01-01 14:06:35 +01:00
Kenneth SkovhedeandGitHub 31503ea595 Added option to log FTP diagnostics data to regular log (#5821) 2024-12-31 16:47:28 +01:00
Kenneth SkovhedeandGitHub 394b876985 Enable noop daemon for FTP (#5813)
This fixes an issue with timeouts on large file.
2024-12-26 10:41:06 +01:00
Marcelo C. c8c79d09eb Fix to re-introduce Unscaping directory names for FTP Client
The need for this was detected by forum post: https://forum.duplicati.com/t/ftp-without-ssl-fails-with-2-1-0-2-beta-2024-11-29/19691/12
2024-12-17 10:11:45 -03:00
Kenneth Skovhede 17cc382325 The legacy flag --use-ssl toggles explicit TLS 2024-12-04 08:34:09 +01:00
Kenneth Skovhede c915b70697 Added support for ftp/aftp treating url paths as before the update 2024-11-21 14:37:25 +01:00
Kenneth Skovhede 9dadd514bf Inverted the flag for relative paths, as that is more compatible with the previous library. 2024-11-21 13:13:44 +01:00
Kenneth Skovhede 5712264e6a Updated some parsing to be simpler.
Changed the strategy to use absolute paths for all operations, to avoid cases where a silent reconnect would end up in a different folder.
Add backwards compatible option to use CWD style relative operations.
Added support for detecting the SSL certificate hash when there is a certificate error.
2024-11-19 13:55:23 +01:00
Kenneth Skovhede 2828729a59 Changed logic for how error messages are constructed 2024-11-19 06:52:17 +01:00
Marcelo Ceccon 3857d0356f Precedence of options match to documentation 2024-10-15 12:58:37 +02:00
Marcelo Ceccon 34f108f127 Implementing backwards compatibility on ftp parameters
With this change, ftp-passive, ftp-regular and use-ssl parameters found on existing FTP Backend configurations will be respected and exhibit the same behavior. They are marked as deprecated so they will issue warning messages when used prompting users to refer to new parameters.
2024-10-15 12:17:51 +02:00
Marcelo Ceccon a4482a4d03 Removing the legacy FTP Backend
For this change, what was known as the alternate FTP client which uses FluentFTP library now officially replaces the FTP Backend which still used the deprecated FtpWebrequest.

To mantain compatibility with existing configurations, both ftp and aftp targets and configuration prefixes are accepted.
2024-10-11 11:21:54 +02:00
Kenneth Skovhede 61ea36091a Added DNSNames as async 2024-10-02 09:37:52 +02:00
Kenneth Skovhede 586c08522e Implemented async method for Test, CreateFolder and Quota in all backends.
Still missing the List and DNSHostnames.
The AsyncRequest class is also preventing many backends from fully upgrading.
2024-10-01 09:30:02 +02:00
Kenneth Skovhede ecf2e8b551 Implemented DeleteAsync on all backends 2024-09-29 23:04:54 +02:00
Kenneth Skovhede e3e3d1305f Implemented async version of Get for all backends. 2024-09-29 22:00:57 +02:00
Kenneth Skovhede 40dd3c6816 Updated all license mentions to MIT 2024-02-28 15:45:30 +01:00
Kenneth Hsu de2a651763 Fix bug in PutAsync implementations.
Without await, the using statement can dispose the Stream before the
call to PutAsync completes, resulting in an ObjectDisposedException.

This fixes #4556.
2021-06-12 15:12:13 -07:00
Kenneth Hsu 179a99c00c Remove unused property. 2019-05-26 19:47:03 -07:00
Kenneth Hsu 6b4cae3ea4 Disable warning about unused class. 2019-05-26 19:46:47 -07:00
Sean Templeton b02b19e683 Change Put method name to PutAsync 2019-03-17 18:28:45 -05:00
Sean Templeton 9a42eca1d6 Update FTP and Jottacloud backends for async Put 2019-03-05 21:08:25 -06:00
Sean Templeton 0c122ff550 Change IBackend and IStreamingBackend to return Task for Put() 2019-03-03 21:43:10 -06:00
verhoek b2cc18426c Renamed Library.IO to Library.Common.IO.
Moved basic Platform functions to Library.Common.Platform.
Turned IO_OS into property within Library.Common.
2018-11-02 21:34:07 +01:00
verhoek bc053df294 Moved basic IO helper functions to Library.IO. 2018-10-27 12:17:07 +02:00
Kenneth Hsu d4d1945faf Use utility method to append trailing slash.
This removes some duplicated code.
2018-09-22 10:19:45 -07:00
verhoek dafee2b455 Removed unwanted character in setting passive mode. 2018-07-17 21:35:55 +02:00
verhoek 2e4a395402 Braces. 2018-06-28 23:18:18 +02:00
verhoek 470b83c416 Remove lambda. 2018-06-28 23:16:28 +02:00
verhoek 2bcc372d0a Simplified passivemode setting. 2018-06-28 23:10:35 +02:00
verhoek 65b3df52f2 Tidying up. 2018-06-28 21:07:23 +02:00
Kenneth Skovhede bd863016fa Added support for returning multiple DNS names for cache invalidation.
Updated most backends to return the actual DNS names for cache invalidation.
2018-02-26 11:37:10 +01:00
Rune Henriksen fc77b476fc changed from NYI to null returns. Added check to skip DNS check if no DNSName is provided 2018-02-21 22:38:01 +01:00
Rune Henriksen 00292953c3 added DNSName getter on Backend interface and added NotImplementedException methods on each backend class 2018-02-18 00:18:44 +01:00
Kenneth Hsu 8810e0130d Make string comparisons use ordinal (binary) sort rules.
These string comparisons should not be culture-aware.
2017-11-26 11:19:54 -08:00
Tyler Gill dcc9faea31 Make sure HandleListExceptions(Func) calls HandleListExceptions(Action). 2017-10-14 09:17:19 -06:00
Tyler Gill b3a3911d98 Change from wrapping yield returning methods with methods that do a try/catch, since they don't work due to lazy evaluation. 2017-09-25 23:19:31 -06:00
Tyler Gill 38883285ee Change IBackend.List() to return IEnumerable instead of List
By changing to IEnumerable, it is possible to iterate only a portion of the list, which is useful when not all entries are needed (e.g., when testing a connection).
All existing backends have been updated, and any which were able to be changed to yield return results in a straightforward way now do.
Many backends had a try/catch in the List() method. Due to the fact that yield returns can't be placed within a try/catch block, these have been refactored to either scope the try/catch to the parts that (should) be the only places throwing exceptions, so that exceptions are still caught and handled.
Note that lazy evaluation may cause some changes in behavior - exceptions that were previously thrown at the point of invokation of List() may now be thrown while it is being enumerated.
I believe this will not be problematic though, as the only well-known exception seems to be FolderMissingException, which should be thrown by Test(), but TestList() attempts to enumerate the list to force this exception.
Any places that require the legacy behavior can get it by simply converting the lazy enumerable to a List()
2017-09-25 23:17:45 -06:00
Kenneth Skovhede 55e230ff49 Reworked the way the AllowWriteBuffering flag is set to fix errors caused by ContentLength not being set. 2017-05-17 10:59:07 +02:00
Kenneth Skovhede 0c68daff6c Fixed all whitespace to be 4 spaces instead of tabs 2016-09-15 11:39:27 +02:00
Kenneth Skovhede d0711011a2 Rewrote all WebRequest code to use AsyncHttpRequest, and normalized usage such that WebResponse objects are always correctly disposed. 2016-04-16 11:12:28 +02:00
Kenneth Skovhede 3149064cde Merge branch 'no_more_resx' 2015-01-20 21:45:54 +01:00
Kenneth Skovhede 8d13e698eb Updated copyright notices 2015-01-20 21:44:52 +01:00
Kenneth Skovhede 16c791f0b5 Removed all resx files, now using Duplicati.Library.Localization exclusively 2015-01-20 21:07:24 +01:00
Kenneth Skovhede 86abc7565a Added locally allocated buffers for copystream to reduce pressure on allocator 2014-11-10 18:38:18 +01:00
Kenneth Skovhede f935af9968 Reworked the ReadWriteTimeout usage to avoid premature timeouts on Mono 2014-07-11 01:07:48 +02:00