chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e8ab3cc
)
ratelimit: if interval/burst are set to 0, assume ratelimiting shall be disabled
author
Lennart Poettering
<lennart@poettering.net>
Wed, 8 Feb 2012 20:35:49 +0000
(21:35 +0100)
committer
Lennart Poettering
<lennart@poettering.net>
Wed, 8 Feb 2012 20:35:49 +0000
(21:35 +0100)
src/ratelimit.c
patch
|
blob
|
history
diff --git
a/src/ratelimit.c
b/src/ratelimit.c
index 1ddc83187f59295fc2402a63a75fa637fbf88210..93157c7a2e071cb177676909e04cab3be11d54ed 100644
(file)
--- 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) {