-
-
Notifications
You must be signed in to change notification settings - Fork 657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Capabilities & HashAlgorithms can cause sync-over-async #683
Comments
Very good find! I'll try fixing it and let you know. |
Fixed. Works for you? |
It will now throw an exception if you attempt to do any operation without |
Hi Robin, thanks for the release. By looking at fc22c61 I still foresee a possible problematic scenario (I haven't tested it) var client = new FtpClient();
client.Connect();
client.Disconnect(); // <-- let's say this happens implicitly somewhere
var capabilities = client.Capabilities; // throws an exception even though the data was populated due the explicit call to Connect() |
I've completely disabled calling |
I see that an |
What if you disconnected and changed the server info and reconnected? Then it would have outdated info. |
Then the new call to |
Okay, we can do a check. If |
I would say so.
I agree that is doesn't make much sense from a user perspective to explicitly disconnect and then and for capabilities, but the disconnect might happen from within the library which gives the strange stack trace. |
Done. Please verify. |
Not good enough! If I agree not to call Connect in Capabilites and Hash_Algorithms - although with the current, much improved Async capabilities one could call a async path just as it is done in I would like to cross-reference here to issue #1698 - where the exception message "Please call connect.....before reading capabilites" is causing some confusion in relation to auto-connect and auto-reconnect. |
FTP OS:
Unix (based on vsFTPd being for unix-like systems)
FTP Server:
vsFTPd 2.2.2 (based on STAT)
Url: ftp://tgftp.nws.noaa.gov
Computer OS:
Windows Server 2019
FluentFTP Version:
33.0.3
While investigating the two stack trace posted below I started wondering why
Capabilities
andHashAlgorithms
containedMy best guess is to initialize them, if someone calls them before calling
Connect
orConnectAsync
which initializes them.I'm not sure why it would be necessary to reconnect to get those values if
m_stream
was nulled or disconnected, but it can cause a sync-over-async path,VerifyTransferAsync -> ... -> Connect()
as seen in the two stack traces.Without being familiar with the codebase or all the edge cases of ftp connections, I think this might improve the situation.
Logs :
Not sure if trace logs are relevant here.
The text was updated successfully, but these errors were encountered: