GHashTableIter it;
gpointer k, v;
struct rspamd_re_class *re_class;
- guint i;
g_assert (cache != NULL);
g_hash_table_iter_init (&it, cache->re_classes);
*/
rspamd_regexp_set_cache_id (re, cache->nre ++);
nre = rspamd_regexp_ref (re);
- g_hash_table_insert (re_class->re, re, re);
+ g_hash_table_insert (re_class->re, nre, nre);
}
void
src = g_hash_table_lookup (re_class->re, what);
if (src) {
- g_hash_table_replace (re_class->re, what, with);
+ /*
+ * On calling of this function, we actually unref old re
+ */
+ g_hash_table_insert (re_class->re, what, rspamd_regexp_ref (with));
}
}
}
struct rspamd_re_class *re_class;
rspamd_cryptobox_hash_state_t st;
rspamd_regexp_t *re;
- guint i;
guchar hash_out[rspamd_cryptobox_HASHBYTES];
g_assert (cache != NULL);
/* Get list of specified headers */
headerlist = rspamd_message_get_header (task,
re_class->type_data,
- FALSE);
+ is_strong);
if (headerlist) {
cur = headerlist;
rspamd_regexp_get_pattern (re));
return 0;
}
+
+ return rspamd_re_cache_exec_re (task, rt, re, re_class, re_id,
+ is_strong, is_multiple);
}
return 0;