diff --git a/Source/AaxDecrypter/NetworkFileStream.cs b/Source/AaxDecrypter/NetworkFileStream.cs index bebde73d..334357f6 100644 --- a/Source/AaxDecrypter/NetworkFileStream.cs +++ b/Source/AaxDecrypter/NetworkFileStream.cs @@ -156,7 +156,7 @@ namespace AaxDecrypter _downloadedPiece = new EventWaitHandle(false, EventResetMode.AutoReset); //Download the file in the background. - return DownloadFile(networkStream); + return Task.Run(async () => await DownloadFile(networkStream), _cancellationSource.Token); } /// Download to . @@ -273,7 +273,7 @@ namespace AaxDecrypter }; WaitToPosition(newPosition); - return IsCancelled ? 0 : (_readFile.Position = newPosition); + return _readFile.Position = newPosition; } /// Blocks until the file has downloaded to at least , then returns.