mirror of
https://github.com/rmcrackan/Libation.git
synced 2026-05-18 13:41:27 -04:00
Exit download loop if zero bytes are read.
This commit is contained in:
@@ -221,9 +221,10 @@ namespace AaxDecrypter
|
||||
|
||||
try
|
||||
{
|
||||
int bytesRead;
|
||||
do
|
||||
{
|
||||
var bytesRead = _networkStream.Read(buff, 0, DOWNLOAD_BUFF_SZ);
|
||||
bytesRead = _networkStream.Read(buff, 0, DOWNLOAD_BUFF_SZ);
|
||||
_writeFile.Write(buff, 0, bytesRead);
|
||||
|
||||
downloadPosition += bytesRead;
|
||||
@@ -237,7 +238,7 @@ namespace AaxDecrypter
|
||||
downloadedPiece.Set();
|
||||
}
|
||||
|
||||
} while (downloadPosition < ContentLength && !IsCancelled);
|
||||
} while (downloadPosition < ContentLength && !IsCancelled && bytesRead > 0);
|
||||
|
||||
_writeFile.Close();
|
||||
_networkStream.Close();
|
||||
|
||||
Reference in New Issue
Block a user