blob: 86412e05656a7a421e15d58634fa001af618c582 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
"""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"
|