Tor
0.4.7.0-alpha-dev
|
Summarize similar messages that would otherwise flood the logs. More...
#include "lib/log/ratelim.h"
#include "lib/malloc/malloc.h"
#include "lib/string/printf.h"
#include "lib/intmath/muldiv.h"
Go to the source code of this file.
Functions | |
static int | rate_limit_is_ready (ratelim_t *lim, time_t now) |
char * | rate_limit_log (ratelim_t *lim, time_t now) |
Summarize similar messages that would otherwise flood the logs.
Definition in file ratelim.c.
|
static |
If the rate-limiter lim is ready at now, return the number of calls to rate_limit_is_ready (including this one!) since the last time rate_limit_is_ready returned nonzero. Otherwise return 0. If the call number hits RATELIM_TOOMANY limit, drop a warning about this event and stop counting.
Definition at line 22 of file ratelim.c.
Referenced by rate_limit_log().