[MIRROR] adds a timeout to tgui payloads (#11535)

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-08-29 16:55:44 -07:00
committed by GitHub
parent 8bd4e1a84a
commit b3e84aecb7
4 changed files with 68 additions and 40 deletions

View File

@@ -134,26 +134,9 @@
if(type == "entry" || type == "force")
var/id = href_list["packetId"]
if(!isnull(id))
id = text2num(id)
var/total = text2num(href_list["totalPackets"])
if(id == 1)
if(total > MAX_MESSAGE_CHUNKS)
return
partial_packets = new /list(total)
partial_packets[id] = href_list["packet"]
if(id != total)
return
var/assembled_payload = ""
for(var/packet in partial_packets)
assembled_payload += packet
payload = json_decode(assembled_payload)
partial_packets = null
payload = handle_packets(id, href_list["totalPackets"], href_list["packet"])
if(!payload)
return FALSE
handle_entry(type, payload)
return TRUE
if(type == "lenwarn")