26 #ifndef _RATELIM_INTERNAL_H_
27 #define _RATELIM_INTERNAL_H_
60 struct timeval tick_timeout;
63 unsigned msec_per_tick;
70 ev_uint32_t current_tick);
74 ev_uint32_t ev_token_bucket_get_tick(
const struct timeval *tv,
84 ev_uint32_t current_tick,
87 int bufferevent_remove_from_rate_limit_group_internal(
struct bufferevent *bev,
91 #define ev_token_bucket_decrement_read(b,n) \
93 (b)->read_limit -= (n); \
96 #define ev_token_bucket_decrement_write(b,n) \
98 (b)->write_limit -= (n); \
ev_uint32_t last_updated
When was this bucket last updated? Measured in abstract 'ticks' relative to the token bucket configur...
Definition: ratelim-internal.h:44
size_t write_rate
How many bytes are we willing to write on average per tick?
Definition: ratelim-internal.h:54
size_t read_maximum
How many bytes are we willing to read at most in any one tick?
Definition: ratelim-internal.h:52
size_t read_rate
How many bytes are we willing to read on average per tick?
Definition: ratelim-internal.h:50
A token bucket is an internal structure that tracks how many bytes we are currently willing to read o...
Definition: ratelim-internal.h:38
Configuration info for a token bucket or set of token buckets.
Definition: ratelim-internal.h:48
Common convenience functions for cross-platform portability and related socket manipulations.
size_t write_maximum
How many bytes are we willing to write at most in any one tick?
Definition: ratelim-internal.h:56
Shared implementation of a bufferevent.
Definition: bufferevent_struct.h:70
ev_ssize_t read_limit
How many bytes are we willing to read or write right now? These values are signed so that we can do "...
Definition: ratelim-internal.h:41