rt->stat.regexp_matched += r;
}
}
- else {
- r = 0;
- }
return r;
}
struct rspamd_re_class *re_class,
gboolean is_strong)
{
- guint ret = 0, i;
+ guint ret = 0, i, re_id;
GList *cur, *headerlist;
GHashTableIter it;
struct raw_header *rh;
msg_debug_re_cache ("get to the slow path for re type: %s: %s",
rspamd_re_cache_type_to_string (re_class->type),
rspamd_regexp_get_pattern (re));
+ re_id = rspamd_regexp_get_cache_id (re);
switch (re_class->type) {
case RSPAMD_RE_HEADER:
/* Match re */
if (in) {
- ret += rspamd_re_cache_process_regexp_data (rt, re, in,
+ ret = rspamd_re_cache_process_regexp_data (rt, re, in,
strlen (in), raw);
debug_task ("checking header %s regexp: %s -> %d",
re_class->type_data,
}
if (len > 0) {
- ret += rspamd_re_cache_process_regexp_data (rt, re, in,
+ ret = rspamd_re_cache_process_regexp_data (rt, re, in,
len, raw);
debug_task ("checking mime regexp: %s -> %d",
rspamd_regexp_get_pattern (re), ret);
len = url->urllen;
raw = FALSE;
- ret += rspamd_re_cache_process_regexp_data (rt, re, in,
+ ret = rspamd_re_cache_process_regexp_data (rt, re, in,
len, raw);
}
len = url->urllen;
raw = FALSE;
- ret += rspamd_re_cache_process_regexp_data (rt, re, in,
+ ret = rspamd_re_cache_process_regexp_data (rt, re, in,
len, raw);
}
}
#endif
- return ret;
+ return rt->results[re_id];
}
gint