Commit Graph
39 Commits
Author SHA1 Message Date
Kenneth Skovhede 40dd3c6816 Updated all license mentions to MIT 2024-02-28 15:45:30 +01:00
gpatel-frandGitHub 4012e7f608 add console log to the Alternative FTP backend for debugging purposes (#5034) 2023-09-24 10:52:57 +02:00
taz-ilandgpatel-fr f791066b7a FluentFTP version update - Fix handling of missing base folder (#4946)
* Improve errors specificity by:
a. Avoiding unnecesary wrapping in AggregateException - Using Library.Utility.Await instead of Wait / Result
b. Using messages from InnerException during TestConnection

* Fix detection of missing base directory:
Depend on error code while trying to SetWorkingDirectory, rather than very wide try/catch and a hardcoded error string (Different FTP servers return different error strings. E.g. hardcoded here was "Directory not found." while Filezilla returns "Can't open file or directory").

* Fix indentation

Intentionally seperated from the previous commit for easier reviewing (otherwise Github text diff display is confused by the removal of the large try / catch blocks)

* Fix creation of missing base directory:
(previously CreateClient would fail since it would try to SetWorkingDirectory to the not-yet-existing directory)
2023-09-24 09:28:19 +02:00
taz-ilandgpatel-fr dbd8cdb86a Update FluentFTP to latest version (46.0.2) (#4935)
* Upgrade FluentFTP to v42 in an attempt to resolve TLS session issues:
duplicati/duplicati#4831

Note v40 introduced breaking changes, specifically seperating between sync and async clients.

Using a different approach this time, single async client.

* Bump FluentFTP to latest (42.0.0 --> 46.0.2)
2023-09-24 09:28:19 +02:00
Kenneth SkovhedeandGitHub e81595a611 Merge pull request #4588 from warwickmm/fix_ftp_path_handling
Fix Alternative FTP handling of paths with escaped characters
2021-08-11 10:41:34 +02:00
Kenneth Hsu 356f270b12 Fix handling of FTP paths that contain escaped characters.
This fixes #4587.
2021-08-10 11:08:31 -07: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
Serge 5404fed634 Do not use StreamWriter 2021-06-02 19:35:40 +10:00
Serge 955dbebc03 Check contents of written test file
Before performing test write, reset stream Position to 0, otherwise test performs zero-byte write.
When performing test read, verify that file was written correctly.
2021-06-01 02:51:42 +10:00
Kenneth Skovhede b7a88c12a9 Changed filesize reading to use await when reading the filesize 2019-10-22 22:52:14 +02:00
Kenneth Skovhede f40746d86d Removed the threadsafe flag from aftp as it cause issues and is not required for Duplicati's use (backends are not assumed to be threadsafe).
Removed the polling code that checks the file size, as the problem should now be fixed with the removal of the threadsafe flag.
2019-10-22 10:54:13 +02:00
Kenneth Skovhede 11f80e3812 Added --aftp-upload-delay option to the aFTP backend. 2019-10-21 08:29:34 +02:00
Kenneth Skovhede a32c31e6bc Fixed the AFTP backend ignoring the --disable-upload-verify option 2019-10-21 08:13:52 +02:00
Kenneth Skovhede f575532cef Updated grammar in the test file text 2019-10-21 08:10:32 +02:00
BlueBlock f72e290b70 poc fix for aftp
proof of concept fix
2019-08-19 19:54:29 -04:00
Sean Templeton b02b19e683 Change Put method name to PutAsync 2019-03-17 18:28:45 -05:00
Sean Templeton 8bd4b825c8 Fix several Codacy issues 2019-03-13 21:51:05 -05:00
Sean Templeton 662627a98a Update AlternativeFtp Backend for async Put
Removed System.Net.FtpClient and added the FluentFTP Nuget package which
is the new name of System.Net.FtpClient.
2019-03-03 21:43:13 -06:00
Sean Templeton 0c122ff550 Change IBackend and IStreamingBackend to return Task for Put() 2019-03-03 21:43:10 -06:00
Jens Glad Balchen 2139faa91b Call SetWorkingDirectory every time an open FTP connection is requested to prevent files from ending up in the root folder if FtpClient fails and silently reconnects.
Fix for issue #3592
2019-01-12 23:32:34 +01: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 71c6aca8a7 Fixed IO calls in Filebackend.
Moved FileEntry to Library.IO due to AlphaFS not implementing
System.IO.FileInfo/DirectoryInfo.
2018-11-01 17:56:48 +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
Kenneth Skovhede 842fd96543 Implemented a new logging system that is more transparent and allows a more granular way of picking log messages.
Added ID's to each log message and each exception to allow later introduction of a Knowledgebase service that explains each error in more detail.
2018-03-15 09:12:34 +01: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 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
Tyler Gill 83a1dcfb64 Replace all instances of InvariantCultureIgnoreCase with OrdinalIgnoreCase in string comparisons.
InvariantCulture is useful when comparing / sorting human language strings in a culturely correct way. It handles things like accented letters in a way that makes sense to humans (e.g., 'a' should be sorted next to 'á', rather than after 'z').
Ordinal looks just at the raw code points of the characters. As such, it is recommended for use in cases when comparing system strings (file paths, command line parameters, config settings, etc.). Since it doesn't need to use the culture specific sorting rules, this method can often be faster.

For more information, see https://stackoverflow.com/questions/492799/difference-between-invariantculture-and-ordinal-string-comparison (and other related questions)
2017-09-18 23:55:08 -06:00
vnau 8f6aacb8c6 AlternativeFTP Backend: Check access permissions (Read/Write/Delete) using test file during connection test.
Issue: #2473
2017-05-24 01:39:30 +07:00
Kenneth Skovhede a029890409 Implemented better default error messsages 2017-01-09 11:35:38 +01:00
seaeagle1 ed62f77864 Fix Listing 2016-12-29 21:20:12 +01:00
seaeagle1 bc9a852fac Reuse FTP connection 2016-12-29 15:00:19 +01:00
seaeagle1 901966ccdd Use CWD to change to path in AlternativeFTP client connection 2016-12-28 19:31:25 +01:00
Kenneth Skovhede 0c68daff6c Fixed all whitespace to be 4 spaces instead of tabs 2016-09-15 11:39:27 +02:00
Kenneth Skovhede aa7af328fb Fixed an issue with parsing ssl options in aftp 2016-04-27 14:48:11 +02:00
Tim Mylemans 9e5c4a81b2 Implemented an alternative FTP backend using System.Net.FtpClient 2016-04-09 11:45:15 +02:00