summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ratelimit.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/ratelimit.c b/src/ratelimit.c
index 1ddc83187f..93157c7a2e 100644
--- a/src/ratelimit.c
+++ b/src/ratelimit.c
@@ -30,11 +30,12 @@
bool ratelimit_test(RateLimit *r) {
usec_t ts;
- ts = now(CLOCK_MONOTONIC);
-
assert(r);
- assert(r->interval > 0);
- assert(r->burst > 0);
+
+ if (r->interval <= 0 || r->burst <= 0)
+ return true;
+
+ ts = now(CLOCK_MONOTONIC);
if (r->begin <= 0 ||
r->begin + r->interval < ts) {