mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-11-08 18:10:37 +00:00
Stop showing "data left after" warning
This commit is contained in:
@@ -36,10 +36,7 @@ class MessageContainer(TLObject):
|
||||
seq_no = reader.read_int()
|
||||
length = reader.read_int()
|
||||
before = reader.tell_position()
|
||||
obj = reader.tgread_object()
|
||||
obj = reader.tgread_object() # May over-read e.g. RpcResult
|
||||
reader.set_position(before + length)
|
||||
messages.append(TLMessage(msg_id, seq_no, obj))
|
||||
if reader.tell_position() != before + length:
|
||||
reader.set_position(before)
|
||||
__log__.warning('Data left after TLObject {}: {!r}'
|
||||
.format(obj, reader.read(length)))
|
||||
return MessageContainer(messages)
|
||||
|
||||
@@ -21,6 +21,9 @@ class RpcResult(TLObject):
|
||||
return RpcResult(msg_id, GzipPacked.from_reader(reader).data, None)
|
||||
|
||||
reader.seek(-4)
|
||||
# This reader.read() will read more than necessary, but it's okay.
|
||||
# We could make use of MessageContainer's length here, but since
|
||||
# it's not necessary we don't need to care about it.
|
||||
return RpcResult(msg_id, reader.read(), None)
|
||||
|
||||
def to_dict(self):
|
||||
|
||||
Reference in New Issue
Block a user