aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-06-21 12:50:42 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-06-22 10:57:29 +0100
commitd432fe8292abdceea2bae0b4a07ea5256247f92d (patch)
tree7904865a6116fe635047ad09565bb9c85dddf955 /src
parent477793ef56061694400a116f43a0e2e41d4efaeb (diff)
downloadrspamd-d432fe8292abdceea2bae0b4a07ea5256247f92d.tar.gz
rspamd-d432fe8292abdceea2bae0b4a07ea5256247f92d.zip
[Test] Fix functional tests case
Diffstat (limited to 'src')
-rw-r--r--src/libserver/task.c15
-rw-r--r--src/libserver/task.h2
2 files changed, 12 insertions, 5 deletions
diff --git a/src/libserver/task.c b/src/libserver/task.c
index 3c92e05b9..04be61744 100644
--- a/src/libserver/task.c
+++ b/src/libserver/task.c
@@ -75,7 +75,7 @@ struct rspamd_task *
rspamd_task_new (struct rspamd_worker *worker, struct rspamd_config *cfg,
rspamd_mempool_t *pool,
struct rspamd_lang_detector *lang_det,
- struct ev_loop *ev_base)
+ struct ev_loop *event_loop)
{
struct rspamd_task *new_task;
@@ -101,9 +101,16 @@ rspamd_task_new (struct rspamd_worker *worker, struct rspamd_config *cfg,
}
}
- new_task->event_loop = ev_base;
- new_task->task_timestamp = ev_time ();
- new_task->time_virtual = ev_now (ev_base);
+ new_task->event_loop = event_loop;
+ if (event_loop) {
+ new_task->task_timestamp = ev_time ();
+ new_task->time_virtual = ev_now (event_loop);
+ }
+ else {
+ new_task->task_timestamp = ev_time ();
+ new_task->time_virtual = rspamd_get_virtual_ticks ();
+ }
+
new_task->time_real_finish = NAN;
new_task->time_virtual_finish = NAN;
diff --git a/src/libserver/task.h b/src/libserver/task.h
index 7b30f97cd..d581378b7 100644
--- a/src/libserver/task.h
+++ b/src/libserver/task.h
@@ -219,7 +219,7 @@ struct rspamd_task *rspamd_task_new (struct rspamd_worker *worker,
struct rspamd_config *cfg,
rspamd_mempool_t *pool,
struct rspamd_lang_detector *lang_det,
- struct ev_loop *ev_base);
+ struct ev_loop *event_loop);
/**
* Destroy task object and remove its IO dispatcher if it exists
*/