Skip to content

Commit

Permalink
fixes to SetDataType, retry GetListing if temporary error, commonize …
Browse files Browse the repository at this point in the history
…CalculateGetListingCommand
  • Loading branch information
robinrodricks committed Jul 18, 2019
1 parent c792a9d commit 5586a6c
Show file tree
Hide file tree
Showing 6 changed files with 239 additions and 217 deletions.
8 changes: 4 additions & 4 deletions FluentFTP/Client/FtpClient_HighLevel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1820,7 +1820,8 @@ private bool DownloadFileInternal(string remotePath, Stream outStream, long rest
#endif

private bool ResumeDownload(string remotePath, ref Stream downStream, long offset, IOException ex) {
// resume if server disconnects midway (fixes #39)

// resume if server disconnects midway (fixes #39 and #410)
if (ex.InnerException != null || ex.Message.IsKnownError(unexpectedEOFStrings)) {
var ie = ex.InnerException as System.Net.Sockets.SocketException;
#if CORE
Expand All @@ -1838,7 +1839,8 @@ private bool ResumeDownload(string remotePath, ref Stream downStream, long offse

#if ASYNC
private async Task<Tuple<bool, Stream>> ResumeDownloadAsync(string remotePath, Stream downStream, long offset, IOException ex) {
// resume if server disconnects midway (fixes #39)

// resume if server disconnects midway (fixes #39 and #410)
if (ex.InnerException != null || ex.Message.IsKnownError(unexpectedEOFStrings)) {
var ie = ex.InnerException as System.Net.Sockets.SocketException;
#if CORE
Expand All @@ -1854,8 +1856,6 @@ private async Task<Tuple<bool, Stream>> ResumeDownloadAsync(string remotePath, S
}
#endif

private static string[] unexpectedEOFStrings = new string[] { "unexpected eof for remote file", "received an unexpected eof", "unexpected eof" };

#endregion

#region Verification
Expand Down
Loading

0 comments on commit 5586a6c

Please sign in to comment.