Skip to content

Commit

Permalink
attempted fix for #318
Browse files Browse the repository at this point in the history
  • Loading branch information
robinrodricks committed Jan 17, 2019
1 parent af2d743 commit 3fb0668
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions FluentFTP/Client/FtpClient_Connection.cs
Expand Up @@ -1199,6 +1199,9 @@ public async Task<FtpReply> GetReplyAsync()
// Create the parser even if the auto-OS detection failed // Create the parser even if the auto-OS detection failed
m_listParser.Init(m_systemType); m_listParser.Init(m_systemType);


// FIX : #318 always set the type when we create a new connection
ForceSetDataType = true;

#if !CORE14 #if !CORE14
} }
#endif #endif
Expand Down
9 changes: 8 additions & 1 deletion FluentFTP/Client/FtpClient_LowLevel.cs
Expand Up @@ -1376,6 +1376,8 @@ public virtual async Task<Stream> OpenAppendAsync(string path, FtpDataType type,


#region Set Data Type #region Set Data Type


protected bool ForceSetDataType = false;

/// <summary> /// <summary>
/// Sets the data type of information sent over the data stream /// Sets the data type of information sent over the data stream
/// </summary> /// </summary>
Expand All @@ -1385,8 +1387,13 @@ public virtual async Task<Stream> OpenAppendAsync(string path, FtpDataType type,
lock (m_lock) { lock (m_lock) {
#endif #endif
// FIX : #291 only change the data type if different // FIX : #291 only change the data type if different
if (CurrentDataType != type) if (CurrentDataType != type || ForceSetDataType) {

// FIX : #318 always set the type when we create a new connection
ForceSetDataType = false;

this.SetDataTypeInternal(type); this.SetDataTypeInternal(type);
}
#if !CORE14 #if !CORE14
} }
#endif #endif
Expand Down

0 comments on commit 3fb0668

Please sign in to comment.