guint flags;
} rspamd_stat_token_t;
+struct rspamd_stat_ctx;
+
/**
* The results of statistics processing:
* - error
*/
void rspamd_stat_close (void);
+/**
+ * Tokenize task
+ * @param st_ctx
+ * @param task
+ */
+void rspamd_stat_process_tokenize (struct rspamd_stat_ctx *st_ctx,
+ struct rspamd_task *task);
+
/**
* Classify the task specified and insert symbols if needed
* @param task
/*
* Tokenize task using the tokenizer specified
*/
-static void
+void
rspamd_stat_process_tokenize (struct rspamd_stat_ctx *st_ctx,
struct rspamd_task *task)
{
guchar hout[rspamd_cryptobox_HASHBYTES];
gchar *b32_hout;
+ if (st_ctx == NULL) {
+ st_ctx = rspamd_stat_get_ctx ();
+ }
+
+ g_assert (st_ctx != NULL);
+
for (i = 0; i < task->text_parts->len; i++) {
part = g_ptr_array_index (task->text_parts, i);
struct rspamd_statfile *st;
gpointer bk_run;
- rspamd_stat_process_tokenize (st_ctx, task);
+ if (task->tokens == NULL) {
+ rspamd_stat_process_tokenize (st_ctx, task);
+ }
+
task->stat_runtimes = g_ptr_array_sized_new (st_ctx->statfiles->len);
g_ptr_array_set_size (task->stat_runtimes, st_ctx->statfiles->len);
rspamd_mempool_add_destructor (task->task_pool,