additional time slicing for flow

This commit is contained in:
Green Sky
2025-12-13 13:33:42 +01:00
parent 404669eb7e
commit 308790dc3a
2 changed files with 11 additions and 1 deletions

View File

@@ -102,6 +102,8 @@ int64_t CUBIC::canSend(float time_delta) {
// this is mostly to prevent spikes on empty windows
const auto rate = window / getCurrentDelay();
// TODO: time slicing alla flow
// we dont want this limit to fall below atleast 1 segment
const int64_t max_bytes_per_tick = std::max<int64_t>(rate * time_delta + 0.5f, MAXIMUM_SEGMENT_SIZE);
cspace_bytes = std::min<int64_t>(cspace_bytes, max_bytes_per_tick);