diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libmime/mime_expressions.c | 10 | ||||
-rw-r--r-- | src/libmime/mime_expressions.h | 7 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/libmime/mime_expressions.c b/src/libmime/mime_expressions.c index acc2caf0a..ad2f5e34b 100644 --- a/src/libmime/mime_expressions.c +++ b/src/libmime/mime_expressions.c @@ -143,6 +143,7 @@ static struct _fl *list_ptr = &rspamd_functions_list[0]; static guint32 functions_number = sizeof (rspamd_functions_list) / sizeof (struct _fl); static gboolean list_allocated = FALSE; +static guint max_re_data = 0; /* Bsearch routine */ static gint @@ -1257,3 +1258,12 @@ rspamd_has_fake_html (struct rspamd_task * task, GList * args, void *unused) return res; } + +guint +rspamd_mime_expression_set_re_limit (guint limit) +{ + guint ret = max_re_data; + + max_re_data = limit; + return ret; +} diff --git a/src/libmime/mime_expressions.h b/src/libmime/mime_expressions.h index ea00bc278..27050ed19 100644 --- a/src/libmime/mime_expressions.h +++ b/src/libmime/mime_expressions.h @@ -57,4 +57,11 @@ void task_cache_add (struct rspamd_task *task, */ gint32 task_cache_check (struct rspamd_task *task, struct rspamd_regexp_element *re); +/** + * Set global limit of regexp data size to be processed + * @param limit new limit in bytes + * @return old limit value + */ +guint rspamd_mime_expression_set_re_limit (guint limit); + #endif |