From b79037baae40fec378c98d9e89c11798adf5691f Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 12 Apr 2016 11:00:42 +0100 Subject: [Minor] Properly place timers calculations --- src/libserver/re_cache.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') 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; -- cgit v1.2.3