quinn-rs / quinn

Async-friendly QUIC implementation in Rust
Apache License 2.0
3.85k stars 394 forks source link

Add data limits settings to connections #1384

Closed inflation closed 2 years ago

inflation commented 2 years ago

Fix #1342

Although it's seemingly straightforward, I'm not sure receive_window is actually used to limit the data. There is a received_max_data() but it can only increase max_data, and I'm not seeing any reasoning why it can't be set to lower values. Anyone familiar with it are welcome to shed some light.

inflation commented 2 years ago

I would assume the main usage for connection level data limit is to adapt to changing constraints once the connection is established. If these two properties can only go up, maybe we just state it in the doc and don't provide the knobs at all.

It's still a useful thing to have but would be inconsistent with the options in transport level.

Ralith commented 2 years ago

If these two properties can only go up

That isn't the case. Existing flow control credit, including flow control credit issued implicitly on new streams, cannot be rescinded, but future flow control credit can be issued according to whatever logic we like, which can include arbitrary decreases.

Ralith commented 2 years ago

https://github.com/quinn-rs/quinn/pull/1386 implemented the connection-scoped configuration; feel free to open a new PR if you still want to pursue dynamic per-stream limits.