mirror of
https://github.com/wiz0u/WTelegramClient.git
synced 2026-04-06 06:53:47 +00:00
Prevent "recursive" MsgContainer
This commit is contained in:
parent
1048af4dcf
commit
c631072ae4
4 changed files with 5 additions and 6 deletions
|
|
@ -689,7 +689,7 @@ namespace WTelegram
|
|||
Rpc prevRequest;
|
||||
lock (_pendingRpcs)
|
||||
_pendingRpcs.TryGetValue(badMsgNotification.bad_msg_id, out prevRequest);
|
||||
await SendAsync(lastSentMsg, true, prevRequest);
|
||||
await SendAsync(lastSentMsg, lastSentMsg is not MsgContainer, prevRequest);
|
||||
lock (_pendingRpcs)
|
||||
_pendingRpcs.Remove(badMsgNotification.bad_msg_id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -198,12 +198,12 @@ namespace TL
|
|||
writer.Write(msg.msg_id);
|
||||
writer.Write(msg.seqno);
|
||||
var patchPos = writer.BaseStream.Position;
|
||||
writer.Write(0); // patched below
|
||||
writer.WriteTLObject(msg.body);
|
||||
writer.Write(0); // patched below
|
||||
if ((msg.seqno & 1) != 0)
|
||||
WTelegram.Helpers.Log(1, $" → {msg.body.GetType().Name.TrimEnd('_'),-38} #{(short)msg.msg_id.GetHashCode():X4}");
|
||||
else
|
||||
WTelegram.Helpers.Log(1, $" → {msg.body.GetType().Name.TrimEnd('_'),-38}");
|
||||
writer.WriteTLObject(msg.body);
|
||||
writer.BaseStream.Position = patchPos;
|
||||
writer.Write((int)(writer.BaseStream.Length - patchPos - 4)); // patch bytes field
|
||||
writer.Seek(0, SeekOrigin.End);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue