From 14c1c342fadc78232bc4dfefb6b39d7f07bf456a Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 24 Dec 2019 16:31:40 +0000 Subject: [PATCH] [Minor] Slightly change fp logic --- src/libserver/re_cache.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libserver/re_cache.c b/src/libserver/re_cache.c index 1579092dc..7bab42e5d 100644 --- a/src/libserver/re_cache.c +++ b/src/libserver/re_cache.c @@ -33,6 +33,7 @@ #include "unix-std.h" #include #include +#include #include "contrib/libev/ev.h" #ifndef WITH_PCRE2 @@ -538,7 +539,7 @@ rspamd_re_cache_process_pcre (struct rspamd_re_runtime *rt, const gchar *start = NULL, *end = NULL; guint max_hits = rspamd_regexp_get_maxhits (re); guint64 id = rspamd_regexp_get_cache_id (re); - gdouble t1, t2, pr; + gdouble t1 = NAN, t2, pr; const gdouble slow_time = 1e8; if (in == NULL) { @@ -587,7 +588,7 @@ rspamd_re_cache_process_pcre (struct rspamd_re_runtime *rt, rt->stat.regexp_matched += r; } - if (pr > 0.9) { + if (!isnan (t1)) { t2 = rspamd_get_ticks (TRUE); if (t2 - t1 > slow_time) { -- 2.39.5