Fix "Invalid frame_len" when downloading files

This commit is contained in:
Wizou 2021-09-18 02:40:58 +02:00
parent 3918362743
commit f6cc00068a
2 changed files with 3 additions and 3 deletions

View file

@ -325,7 +325,7 @@ namespace WTelegram
if (await FullReadAsync(stream, overhead, 4, ct) != 4)
throw new ApplicationException("Could not read payload length : Connection shut down");
int length = BinaryPrimitives.ReadInt32LittleEndian(overhead);
if (length <= 0 || length >= 0x10000)
if (length <= 0)
throw new ApplicationException("Invalid frame_len");
var payload = new byte[length];
if (await FullReadAsync(stream, payload, length, ct) != length)

View file

@ -7073,8 +7073,8 @@ namespace TL
});
///<summary>See <a href="https://core.telegram.org/method/account.updateStatus"/></summary>
public static Task<Bool> Account_UpdateStatus(this Client client, bool offline)
=> client.CallAsync<Bool>(writer =>
public static Task<bool> Account_UpdateStatus(this Client client, bool offline)
=> client.CallAsync<bool>(writer =>
{
writer.Write(0x6628562C);
writer.Write(offline ? 0x997275B5 : 0xBC799737);