mirror of
https://github.com/wiz0u/WTelegramClient.git
synced 2026-04-05 06:25:30 +00:00
Fix progressCallback abort/exception handling during DownloadFileAsync
This commit is contained in:
parent
7c7a2a0625
commit
6a75f0a9d8
2 changed files with 2 additions and 2 deletions
|
|
@ -378,6 +378,7 @@ namespace WTelegram
|
|||
await outputStream.WriteAsync(fileData.bytes, 0, fileData.bytes.Length);
|
||||
maxOffsetSeen = Math.Max(maxOffsetSeen, offset + fileData.bytes.Length);
|
||||
transmitted += fileData.bytes.Length;
|
||||
progress?.Invoke(transmitted, fileSize);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
|
@ -387,7 +388,6 @@ namespace WTelegram
|
|||
finally
|
||||
{
|
||||
writeSem.Release();
|
||||
progress?.Invoke(transmitted, fileSize);
|
||||
}
|
||||
}
|
||||
lock (tasks) tasks.Remove(offset);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue