summaryrefslogtreecommitdiff
path: root/src/common/token_bucket.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-04-10 12:33:30 -0400
committerNick Mathewson <nickm@torproject.org>2018-04-13 10:41:14 -0400
commit8a852397462e39cfbc21e3cea20ddd39be40598d (patch)
treed2f55e9b9ae4f573f1d29b6b2aade39e93d58262 /src/common/token_bucket.h
parentc376200f6a77b2509928bc08d2aa1245028cec30 (diff)
downloadtor-8a852397462e39cfbc21e3cea20ddd39be40598d.tar.gz
tor-8a852397462e39cfbc21e3cea20ddd39be40598d.zip
Add a helper function to decrement read and write at the same time
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 ef0735219e..2d1ccd5cf3 100644
--- a/src/common/token_bucket.h
+++ b/src/common/token_bucket.h
@@ -43,6 +43,9 @@ int token_bucket_dec_read(token_bucket_t *bucket,
int token_bucket_dec_write(token_bucket_t *bucket,
ssize_t n);
+void token_bucket_dec(token_bucket_t *bucket,
+ ssize_t n_read, ssize_t n_written);
+
static inline size_t token_bucket_get_read(const token_bucket_t *bucket);
static inline size_t
token_bucket_get_read(const token_bucket_t *bucket)