Skip to content

Allow receivers to limit the size of fragmented messages - #322

Open
maximmaxim345 wants to merge 1 commit into
mainfrom
fix/fragment-size-limit
Open

maximmaxim345 wants to merge 1 commit into
mainfrom
fix/fragment-size-limit

Conversation

@maximmaxim345

Copy link
Copy Markdown
Member

The fragmentation rules had no size limit, so a peer could send a first fragment followed by non-last fragments forever and grow the receiver's reassembly buffer without bound.

Receivers may now close the connection once the reassembled data passes a limit they choose. I didn't pick a fixed number since the spec doesn't bound sample rate, channels or bit depth. A 150 ms PCM chunk at 384 kHz, 8 channels and 24-bit is already about 1.38 MB, and a fixed cap large enough for that wouldn't protect small devices. Each receiver knows what it can receive, so it can pick its own.

The limit says "valid message" instead of "message from a well-behaved client or server", since "valid" is what the rest of the spec already uses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant