]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] Allow to work with no ratelimits
authorVsevolod Stakhov <vsevolod@rspamd.com>
Tue, 4 Feb 2025 10:15:30 +0000 (10:15 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Tue, 4 Feb 2025 10:15:30 +0000 (10:15 +0000)
src/fuzzy_storage.c

index c29ac52650e06189db2fffd80ab15c49a679d655..919ea2118bea449ca48c868db85bfb6236ba5ec3 100644 (file)
@@ -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