[tor-bugs] #25793 [Core Tor/Tor]: Refactor refactored token bucket API to be more generic

Tor Bug Tracker & Wiki blackhole at torproject.org
Fri Apr 13 19:16:44 UTC 2018


#25793: Refactor refactored token bucket API to be more generic
---------------------------------+------------------------------------
 Reporter:  nickm                |          Owner:  nickm
     Type:  defect               |         Status:  needs_review
 Priority:  Medium               |      Milestone:  Tor: 0.3.4.x-final
Component:  Core Tor/Tor         |        Version:
 Severity:  Normal               |     Resolution:
 Keywords:  034-roadmap-subtask  |  Actual Points:
Parent ID:  #25373               |         Points:
 Reviewer:  dgoulet              |        Sponsor:  Sponsor8-can
---------------------------------+------------------------------------

Comment (by nickm):

 Replying to [comment:4 dgoulet]:
 > So hmmm, for anyone to implement a token bucket, they would need to
 create a specialized version? The `token_bucket_raw_reset()` API function
 has the `token_bucket_timestamp_t` as a param which means any specialized
 token object will kind of need to use that timestamp struct? Or not use
 the raw reset?

 This changed in d0769156a67873e98ff08f6ab5e7d37e4b4866a6 -- it doesn't
 take a timestamp any more.

 > Where `token_bucket_raw_refill_steps()` only takes "steps" which means
 that if one would use the token bucket API without creating a new object,
 it would need to compute that steps value on its side instead of within a
 `token_bucket_t` API?

 Right.  It needs to pass the time elapsed.

 > In other words, the implementation using the token bucket will always
 need to keep the last refilled time or create a specialized object?

 Yes, that's right.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/25793#comment:5>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list