Skip to content
Permalink
Browse files

Merge pull request #202 from bgroenks96/bugfix/threadsafe-settings

Fix DownloadFileInternal not recognizing the download data type
with EnableThreadSafeConnections enabled.
  • Loading branch information...
Robin Rodricks
Robin Rodricks committed Sep 26, 2017
2 parents d933b30 + ee4bf40 commit 6cb443800a1040735a8bb8847cc5ff1c3228b578
Showing with 5 additions and 3 deletions.
  1. +2 −0 FluentFTP/Client/FtpClient_Connection.cs
  2. +3 −3 FluentFTP/Client/FtpClient_LowLevel.cs
@@ -782,6 +782,8 @@ public partial class FtpClient : IDisposable {
conn.UploadRateLimit = UploadRateLimit;
conn.DownloadRateLimit = DownloadRateLimit;
conn.RecursiveList = RecursiveList;
conn.DownloadDataType = DownloadDataType;
conn.UploadDataType = UploadDataType;
#if !CORE
conn.PlainTextEncryption = PlainTextEncryption;
#endif
@@ -803,17 +803,17 @@ async Task<FtpDataStream> OpenDataStreamAsync(string command, long restart)
long length = 0;

#if !CORE14
lock (m_lock) {
lock (m_lock) {
#endif
if (m_threadSafeDataChannels) {
this.SetDataType(type);
if (m_threadSafeDataChannels) {
client = CloneConnection();
client.Connect();
client.SetWorkingDirectory(GetWorkingDirectory());
} else {
client = this;
}

client.SetDataType(type);
length = checkIfFileExists ? client.GetFileSize(path) : 0;
stream = client.OpenDataStream(("RETR " + path.GetFtpPath()), restart);
#if !CORE14

0 comments on commit 6cb4438

Please sign in to comment.
You can’t perform that action at this time.