mirror of
https://github.com/wiz0u/WTelegramClient.git
synced 2025-12-06 06:52:01 +01:00
Fix "Invalid frame_len" when downloading files
This commit is contained in:
parent
3918362743
commit
f6cc00068a
|
|
@ -325,7 +325,7 @@ namespace WTelegram
|
||||||
if (await FullReadAsync(stream, overhead, 4, ct) != 4)
|
if (await FullReadAsync(stream, overhead, 4, ct) != 4)
|
||||||
throw new ApplicationException("Could not read payload length : Connection shut down");
|
throw new ApplicationException("Could not read payload length : Connection shut down");
|
||||||
int length = BinaryPrimitives.ReadInt32LittleEndian(overhead);
|
int length = BinaryPrimitives.ReadInt32LittleEndian(overhead);
|
||||||
if (length <= 0 || length >= 0x10000)
|
if (length <= 0)
|
||||||
throw new ApplicationException("Invalid frame_len");
|
throw new ApplicationException("Invalid frame_len");
|
||||||
var payload = new byte[length];
|
var payload = new byte[length];
|
||||||
if (await FullReadAsync(stream, payload, length, ct) != length)
|
if (await FullReadAsync(stream, payload, length, ct) != length)
|
||||||
|
|
|
||||||
|
|
@ -7073,8 +7073,8 @@ namespace TL
|
||||||
});
|
});
|
||||||
|
|
||||||
///<summary>See <a href="https://core.telegram.org/method/account.updateStatus"/></summary>
|
///<summary>See <a href="https://core.telegram.org/method/account.updateStatus"/></summary>
|
||||||
public static Task<Bool> Account_UpdateStatus(this Client client, bool offline)
|
public static Task<bool> Account_UpdateStatus(this Client client, bool offline)
|
||||||
=> client.CallAsync<Bool>(writer =>
|
=> client.CallAsync<bool>(writer =>
|
||||||
{
|
{
|
||||||
writer.Write(0x6628562C);
|
writer.Write(0x6628562C);
|
||||||
writer.Write(offline ? 0x997275B5 : 0xBC799737);
|
writer.Write(offline ? 0x997275B5 : 0xBC799737);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue