From 3d6a5334431bbbfc116b1d1241deb33213bacead Mon Sep 17 00:00:00 2001
From: GitHub Action
0-15
Quick ACK ยป may be enabled for this transport.
+To request a quick ACK from the server for an encrypted MTProto payload, add 0x80000000
to the len
field before encoding it (equivalent to doing len = len | (1 << 31)
, i.e. set the most-significant bit of the length).
The server will send quick ACK tokens as a standalone 8 to 16-byte packet (excluding the length of the packet itself, encoded as usual), containing a 4-byte header with all bits set, followed by the ACK token (abcd
), followed by 0 to 8 random padding bytes.
+----+----+----+----...----+
+|tlen|FFFF|abcd| padding |
++----+----+----+----...----+
+These quick ACK packets can be easily distinguished from normal intermediate padded packets because their length will be always smaller than or equal to 16, smaller than any MTProto packet.
+They can be distinguished from transport errors because the first 4 bytes of the payload are equal to 0xFFFFFFFF
, not a valid transport error.
The basic MTProto transport protocol