Remove ticket_cost member as it is no longer needed
This commit is contained in:
@@ -54,15 +54,22 @@ struct RateLimit {
|
||||
|
||||
//internal fields:
|
||||
|
||||
//how much each ticket is worth.
|
||||
long ticket_cost;
|
||||
|
||||
//money we have to "buy" tickets
|
||||
long funds;
|
||||
//time of the previos period
|
||||
long last_ts;
|
||||
};
|
||||
|
||||
/** Static initializer for a struct RateLimit
|
||||
*
|
||||
* @param tickets number of tickets (bucket depth)
|
||||
* @param period per this period
|
||||
*/
|
||||
#define UC_RATELIMIT_INITIALIZER(tickets, period)\
|
||||
{ tickets, period, tickets * period, 0}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Initialize a struct RateLimit, which can hand out @tickets per @period
|
||||
* the perioid must be in the same units as the current_ts
|
||||
|
||||
Reference in New Issue
Block a user