aboutsummaryrefslogtreecommitdiff
path: root/src/common/token_bucket.h
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2018-04-16 15:02:51 -0400
committerDavid Goulet <dgoulet@torproject.org>2018-04-16 15:05:41 -0400
commitae4e5b98245169dc02c12138d4acc69ce7da0261 (patch)
treed328ae19cd0a6eac405847cafec6bd66b411ce72 /src/common/token_bucket.h
parentc7d3de216c60c090fddb4926a739da038bb5d5fe (diff)
downloadtor-ae4e5b98245169dc02c12138d4acc69ce7da0261.tar.gz
tor-ae4e5b98245169dc02c12138d4acc69ce7da0261.zip
token: Fix uint32_t to uint64_t conversion
Unfortunately, the units passed to monotime_coarse_stamp_units_to_approx_msec() was always 0 due to a type conversion. Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/common/token_bucket.h')
-rw-r--r--src/common/token_bucket.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/common/token_bucket.h b/src/common/token_bucket.h
index 329b652f8e..fb5d9fc60a 100644
--- a/src/common/token_bucket.h
+++ b/src/common/token_bucket.h
@@ -10,6 +10,7 @@
#define TOR_TOKEN_BUCKET_H
#include "torint.h"
+#include "testsupport.h"
/** Largest allowable burst value for a token buffer. */
#define TOKEN_BUCKET_MAX_BURST INT32_MAX
@@ -109,6 +110,8 @@ token_bucket_rw_get_write(const token_bucket_rw_t *bucket)
* a power of two if you can. */
#define TICKS_PER_STEP 16
+STATIC uint32_t rate_per_sec_to_rate_per_step(uint32_t rate);
+
#endif
#endif /* TOR_TOKEN_BUCKET_H */