If the total packet size is larger than 1024, then it is splitted into subpackets
Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
@@ -75,6 +75,9 @@ class Squirrel(Hazelnut):
|
||||
"""
|
||||
Send a formatted packet to a client.
|
||||
"""
|
||||
if len(pkt) > 1024:
|
||||
# The packet is too large to be sent by the protocol. We split the packet in subpackets.
|
||||
return sum(self.send_packet(client, subpkt) for subpkt in pkt.split(1024))
|
||||
return self.send_raw_data(client, pkt.marshal())
|
||||
|
||||
def send_raw_data(self, client: Hazelnut, data: bytes) -> int:
|
||||
|
Reference in New Issue
Block a user