struct rspamd_re_class {
guint64 id;
enum rspamd_re_type type;
+ gboolean has_utf8; /* if there are any utf8 regexps */
gpointer type_data;
gsize type_len;
GHashTable *re;
- gchar hash[rspamd_cryptobox_HASHBYTES + 1];
rspamd_cryptobox_hash_state_t *st;
+
+ gchar hash[rspamd_cryptobox_HASHBYTES + 1];
+
#ifdef WITH_HYPERSCAN
hs_database_t *hs_db;
hs_scratch_t *hs_scratch;
g_hash_table_insert (re_class->re, rspamd_regexp_get_id (nre), nre);
}
+ if (rspamd_regexp_get_flags (re) & RSPAMD_REGEXP_FLAG_UTF) {
+ re_class->has_utf8 = TRUE;
+ }
+
return nre;
}
break;
case 'u':
rspamd_flags &= ~RSPAMD_REGEXP_FLAG_RAW;
+ rspamd_flags |= RSPAMD_REGEXP_FLAG_UTF;
#ifndef WITH_PCRE2
regexp_flags |= PCRE_FLAG(UTF8);
#else
break;
case 'r':
rspamd_flags |= RSPAMD_REGEXP_FLAG_RAW;
+ rspamd_flags &= ~RSPAMD_REGEXP_FLAG_UTF;
#ifndef WITH_PCRE2
regexp_flags &= ~PCRE_FLAG(UTF8);
#else
#define RSPAMD_REGEXP_FLAG_FULL_MATCH (1 << 3)
#define RSPAMD_REGEXP_FLAG_PCRE_ONLY (1 << 4)
#define RSPAMD_REGEXP_FLAG_DISABLE_JIT (1 << 5)
+#define RSPAMD_REGEXP_FLAG_UTF (1 << 6)
struct rspamd_config;