Small refactoring of ratelimit code to make more sense

This commit is contained in:
Nils O. Selåsdal
2014-03-09 23:54:48 +01:00
parent 8fca5333d9
commit 15a3cbb59a
2 changed files with 46 additions and 39 deletions
+2 -2
View File
@@ -62,7 +62,7 @@ struct RateLimit {
//money we have to "buy" tickets
long funds;
//time of the previos period
long last_ts;
long last_refill_ts;
};
/** Static initializer for a struct RateLimit
@@ -91,7 +91,7 @@ void uc_ratelimit_init(struct RateLimit *r, long tickets, long period);
* Reset a RateLimit, filling up the tickets again.
*
* @param r RateLimit to reset
* @param current ts, if non-zero, re-sets the last_ts to the current_ts
* @param current ts, if non-zero, re-sets the last_refill_ts to the current_ts
*/
void uc_ratelimit_reset(struct RateLimit *r, long current_ts);