aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/regexp.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-04-13 17:33:41 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-04-13 17:33:41 +0100
commitc4572edbf6d6bec6bb031479a9bcd0a3f1cd1bbe (patch)
treefe5d91e179f6dcea0b151c3c6d2d1e8c39a3a4c2 /src/libutil/regexp.c
parent53c022725a0be4d076523997b052639e7dbc8ede (diff)
downloadrspamd-c4572edbf6d6bec6bb031479a9bcd0a3f1cd1bbe.tar.gz
rspamd-c4572edbf6d6bec6bb031479a9bcd0a3f1cd1bbe.zip
Remove mutexes from regexps since thread pools are removed.
Diffstat (limited to 'src/libutil/regexp.c')
-rw-r--r--src/libutil/regexp.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/src/libutil/regexp.c b/src/libutil/regexp.c
index 61ddc908a..8da36d4cb 100644
--- a/src/libutil/regexp.c
+++ b/src/libutil/regexp.c
@@ -45,7 +45,6 @@ struct rspamd_regexp_s {
#ifdef HAVE_PCRE_JIT
pcre_jit_stack *jstack;
pcre_jit_stack *raw_jstack;
- rspamd_mutex_t *mtx;
#endif
pcre *raw_re;
pcre_extra *raw_extra;
@@ -105,11 +104,7 @@ rspamd_regexp_dtor (rspamd_regexp_t *re)
pcre_free (re->raw_extra);
#endif
}
-#ifdef HAVE_PCRE_JIT
- if (re->mtx) {
- rspamd_mutex_free (re->mtx);
- }
-#endif
+
if (re->pattern) {
g_free (re->pattern);
}
@@ -250,10 +245,6 @@ fin:
if (!(rspamd_flags & RSPAMD_REGEXP_FLAG_NOOPT)) {
/* Optimize regexp */
-#ifdef HAVE_PCRE_JIT
- study_flags |= PCRE_STUDY_JIT_COMPILE;
- res->mtx = rspamd_mutex_new ();
-#endif
if (res->re) {
res->extra = pcre_study (res->re, study_flags, &err_str);
if (res->extra != NULL) {
@@ -343,12 +334,6 @@ rspamd_regexp_search (rspamd_regexp_t *re, const gchar *text, gsize len,
g_assert (r != NULL);
-#ifdef HAVE_PCRE_JIT
- if (re->mtx) {
- rspamd_mutex_lock (re->mtx);
- }
-#endif
-
if (!(re->flags & RSPAMD_REGEXP_FLAG_NOOPT)) {
#ifdef HAVE_PCRE_JIT
# if (PCRE_MAJOR == 8 && PCRE_MINOR >= 32)
@@ -372,11 +357,6 @@ rspamd_regexp_search (rspamd_regexp_t *re, const gchar *text, gsize len,
rc = pcre_exec (r, ext, mt, remain, 0, match_flags, ovec,
G_N_ELEMENTS (ovec));
}
-#ifdef HAVE_PCRE_JIT
- if (re->mtx) {
- rspamd_mutex_unlock (re->mtx);
- }
-#endif
if (rc > 0) {
if (start) {
*start = mt + ovec[0];