"""Limits read by more than one part of the WebRTC session.""" CHUNK_SIZE = 1024 * 1024 # The largest message a peer may send once it has proved the group key. The # largest a client really sends is a sealed playlist blob, 1 MiB (blobs.py); # chat is 64 KiB and an upload chunk 48 KiB. Eight times the largest, because a # message of many small objects decodes to several times its size in memory. MAX_MSG = 8 * 1024 * 1024 # Per container, when a message is decoded: nothing a client sends comes near # them, and without them one message of tiny elements is one enormous list. UNPACK_LIMITS = { "max_array_len": 100_000, "max_map_len": 10_000, "max_str_len": 1024 * 1024, "max_bin_len": MAX_MSG, "max_ext_len": 0, } # What the `tr` on a chunk request turned out to be (see `_lease_of`). LEASE_GRANTED = "granted" LEASE_QUEUED = "queued" LEASE_NONE = "none"