diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-11-19 11:44:01 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-11-19 11:44:01 +0000 |
commit | e2f131f592910225996dc7156749bf93b4d12135 (patch) | |
tree | 37bcb20de8336e4634297220ef911ca1607e1ceb /src | |
parent | ff7c63b24d8e20fa4c75e408a5d29c44b154819f (diff) | |
download | rspamd-e2f131f592910225996dc7156749bf93b4d12135.tar.gz rspamd-e2f131f592910225996dc7156749bf93b4d12135.zip |
[Minor] Improve error messages
Diffstat (limited to 'src')
-rw-r--r-- | src/libserver/re_cache.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/libserver/re_cache.c b/src/libserver/re_cache.c index e4b00e541..40a44cde8 100644 --- a/src/libserver/re_cache.c +++ b/src/libserver/re_cache.c @@ -1769,7 +1769,6 @@ rspamd_re_cache_is_finite (struct rspamd_re_cache *cache, /* Try to compile pattern */ gchar *pat = rspamd_re_cache_hs_pattern_from_pcre (re); - /* Memory leak here but ok since we do exit */ if (hs_compile (pat, flags | HS_FLAG_PREFILTER, @@ -1777,9 +1776,18 @@ rspamd_re_cache_is_finite (struct rspamd_re_cache *cache, &cache->plt, &test_db, &hs_errors) != HS_SUCCESS) { + + msg_info_re_cache ("cannot compile (prefilter mode) '%s' to hyperscan: '%s'", + pat, + hs_errors != NULL ? hs_errors->message : "unknown error"); + + hs_free_compile_error (hs_errors); + g_free (pat); + exit (EXIT_FAILURE); } + g_free (pat); exit (EXIT_SUCCESS); } else if (cld > 0) { @@ -1994,9 +2002,9 @@ rspamd_re_cache_compile_timer_cb (EV_P_ ev_timer *w, int revents ) &cache->plt, &test_db, &hs_errors) != HS_SUCCESS) { - msg_info_re_cache ("cannot compile %s to hyperscan: '%s', try prefilter match", - hs_errors != NULL ? hs_errors->message : "unknown error", - pat); + msg_info_re_cache ("cannot compile '%s' to hyperscan: '%s', try prefilter match", + pat, + hs_errors != NULL ? hs_errors->message : "unknown error"); hs_free_compile_error (hs_errors); /* The approximation operation might take a significant |