updateQuota

fun updateQuota(dtMilliseconds: Int)

Pours dtMilliseconds worth of fresh quota into the bucket, faithful to bandwidth_channel::update_quota:

toAdd = (limit * dt + 500) / 1000        // rounded to nearest byte
quotaLeft += toAdd, saturating at inf
if quotaLeft / 3 > limit: quotaLeft = limit * 3 // 3-second burst cap
distributeQuota = max(quotaLeft, 0)

An unlimited channel (limit 0) does nothing.