mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 14:10:53 +00:00
Misc
This commit is contained in:
@@ -177,22 +177,18 @@ public sealed class WebBrowser : IDisposable {
|
||||
while (response.Content.CanRead) {
|
||||
int read = await response.Content.ReadAsync(buffer.AsMemory(0, buffer.Length), cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (read == 0) {
|
||||
if (read <= 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
await ms.WriteAsync(buffer.AsMemory(0, read), cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if ((progressReporter == null) || (batchIncreaseSize == 0) || (batch >= 99)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
readThisBatch += read;
|
||||
|
||||
while ((readThisBatch >= batchIncreaseSize) && (batch < 99)) {
|
||||
readThisBatch -= batchIncreaseSize;
|
||||
progressReporter.Report(++batch);
|
||||
progressReporter?.Report(++batch);
|
||||
}
|
||||
|
||||
await ms.WriteAsync(buffer.AsMemory(0, read), cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
} catch (OperationCanceledException) when (cancellationToken.IsCancellationRequested) {
|
||||
throw;
|
||||
|
||||
Reference in New Issue
Block a user