commit 14c1c34: [Minor] Slightly change fp logic
Vsevolod Stakhov
vsevolod at highsecure.ru
Tue Dec 24 17:07:11 UTC 2019
Author: Vsevolod Stakhov
Date: 2019-12-24 16:31:40 +0000
URL: https://github.com/rspamd/rspamd/commit/14c1c342fadc78232bc4dfefb6b39d7f07bf456a
[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 <signal.h>
#include <stdalign.h>
+#include <math.h>
#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) {
More information about the Commits
mailing list