From: Vsevolod Stakhov Date: Tue, 4 Feb 2025 10:15:30 +0000 (+0000) Subject: [Fix] Allow to work with no ratelimits X-Git-Tag: 3.11.1~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b365d3657c343afa8d9784d2f58b5ebebc6bac2f;p=thirdparty%2Frspamd.git [Fix] Allow to work with no ratelimits --- diff --git a/src/fuzzy_storage.c b/src/fuzzy_storage.c index c29ac52650..919ea2118b 100644 --- a/src/fuzzy_storage.c +++ b/src/fuzzy_storage.c @@ -441,6 +441,11 @@ rspamd_fuzzy_check_ratelimit_bucket(struct fuzzy_session *session, struct rspamd { gboolean ratelimited = FALSE, new_ratelimit = FALSE; + /* Nothing to check */ + if (isnan(max_burst) || isnan(max_rate)) { + return ratelimit_pass; + } + if (isnan(elt->cur)) { /* There is an issue with the previous logic: the TTL is updated each time * we see that new bucket. Hence, we need to check the `last` and act accordingly