Skip to content
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

Current data type not set when using EnableThreadSafeDataConnections #184

Closed
bgroenks96 opened this issue Sep 13, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@bgroenks96
Copy link
Contributor

commented Sep 13, 2017

EnableThreadSafeDataConnections causes the SetDataType method to only be called on the "cloned" connection the server, and not on the original. In certain cases, such as downloading zero size files, this causes DownloadFileInternal to throw an exception because it thinks the data type is still ASCII.

@robinrodricks

This comment has been minimized.

Copy link
Owner

commented Sep 21, 2017

Do you need enablethreadsafe? It's an old buggy method created by the original author. Can you not just use a background worker or proper thread and create one FTP client instance on each thread? Or even one client can be accessed from multiple threads because we have implemented our own locking..

@bgroenks96

This comment has been minimized.

Copy link
Contributor Author

commented Sep 21, 2017

Not sure I agree that this is incorrect usage; as long as the API exists and is non-deprecated, it shouldn't cause bugs like this.

Using EnableThreadSafeDataConnections fixes several issues I was having with the library causing hangs while downloading/uploading files. The issue with managing my own separate client is that the worker thread is being used internally to my FTP client.

I'll take another look to see if I can avoid that, but I still think this should be fixed. I actually fixed it in my fork, if you want me to submit a PR for it.

@robinrodricks

This comment has been minimized.

Copy link
Owner

commented Sep 21, 2017

Absolutely. Any fixes are much appreciated...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.