diff options
Diffstat (limited to 'src/common/token_bucket.c')
-rw-r--r-- | src/common/token_bucket.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/common/token_bucket.c b/src/common/token_bucket.c index f4d2cccffd..abb0501833 100644 --- a/src/common/token_bucket.c +++ b/src/common/token_bucket.c @@ -178,3 +178,14 @@ token_bucket_dec_write(token_bucket_t *bucket, return decrement_single_bucket(&bucket->write_bucket, n); } +/** + * As token_bucket_dec_read and token_bucket_dec_write, in a single operation. + */ +void +token_bucket_dec(token_bucket_t *bucket, + ssize_t n_read, ssize_t n_written) +{ + token_bucket_dec_read(bucket, n_read); + token_bucket_dec_read(bucket, n_written); +} + |