aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/re_cache.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-04-12 11:00:42 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-04-12 11:00:42 +0100
commitb79037baae40fec378c98d9e89c11798adf5691f (patch)
tree4d7dd86e0b180265215b8b3048da3370e49f429a /src/libserver/re_cache.c
parent0c4a2a3cad17f681af1480ec84b4b2d7ed8195ee (diff)
downloadrspamd-b79037baae40fec378c98d9e89c11798adf5691f.tar.gz
rspamd-b79037baae40fec378c98d9e89c11798adf5691f.zip
[Minor] Properly place timers calculations
Diffstat (limited to 'src/libserver/re_cache.c')
-rw-r--r--src/libserver/re_cache.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/libserver/re_cache.c b/src/libserver/re_cache.c
index 67dd58b23..c2e628206 100644
--- a/src/libserver/re_cache.c
+++ b/src/libserver/re_cache.c
@@ -481,9 +481,9 @@ rspamd_re_cache_process_pcre (struct rspamd_re_runtime *rt,
r = rt->results[id];
- t1 = rspamd_get_ticks ();
-
if (max_hits == 0 || r < max_hits) {
+ t1 = rspamd_get_ticks ();
+
while (rspamd_regexp_search (re,
in,
len,
@@ -505,13 +505,13 @@ rspamd_re_cache_process_pcre (struct rspamd_re_runtime *rt,
if (r > 0) {
rt->stat.regexp_matched += r;
}
- }
- t2 = rspamd_get_ticks ();
+ t2 = rspamd_get_ticks ();
- if (t2 - t1 > slow_time) {
- msg_info_pool ("regexp '%16s' took %.2f seconds to execute",
- rspamd_regexp_get_pattern (re), t2 - t1);
+ if (t2 - t1 > slow_time) {
+ msg_info_pool ("regexp '%16s' took %.2f seconds to execute",
+ rspamd_regexp_get_pattern (re), t2 - t1);
+ }
}
return r;