aboutsummaryrefslogtreecommitdiffstats
path: root/src/worker.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2010-06-22 17:39:03 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2010-06-22 17:39:03 +0400
commite9d2ad6a1b942cb5bbba9a268cc7e0108a0145ea (patch)
treea22232f181b0b6e0af3056869c666578fa30c0c0 /src/worker.c
parentd81433607b87acf08bab4ccb5a01f1c992dfb8bb (diff)
downloadrspamd-e9d2ad6a1b942cb5bbba9a268cc7e0108a0145ea.tar.gz
rspamd-e9d2ad6a1b942cb5bbba9a268cc7e0108a0145ea.zip
* Rewrite buffered input for line policy (again)
* Fix issue with links that are ip addresses in numeric form in surbl * On Darwin use BSD style sendfile definition * Reorganize platform specific knobs in CMakeLists * Use gettimeofday on systems that have not clock_getres * Use ftime for dns trans id generation on systems without clock_getres
Diffstat (limited to 'src/worker.c')
-rw-r--r--src/worker.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/worker.c b/src/worker.c
index 5ebdaf84b..bfc4e4331 100644
--- a/src/worker.c
+++ b/src/worker.c
@@ -412,12 +412,18 @@ construct_task (struct rspamd_worker *worker)
new_task->cfg = worker->srv->cfg;
new_task->from_addr.s_addr = INADDR_NONE;
new_task->view_checked = FALSE;
-#ifdef HAVE_CLOCK_PROCESS_CPUTIME_ID
+#ifdef HAVE_CLOCK_GETTIME
+# ifdef HAVE_CLOCK_PROCESS_CPUTIME_ID
clock_gettime (CLOCK_PROCESS_CPUTIME_ID, &new_task->ts);
-#elif defined(HAVE_CLOCK_VIRTUAL)
+# elif defined(HAVE_CLOCK_VIRTUAL)
clock_gettime (CLOCK_VIRTUAL, &new_task->ts);
-#else
+# else
clock_gettime (CLOCK_REALTIME, &new_task->ts);
+# endif
+#else
+ if (gettimeofday (&new_task->tv, NULL) == -1) {
+ msg_warn ("gettimeofday failed: %s", strerror (errno));
+ }
#endif
io_tv.tv_sec = WORKER_IO_TIMEOUT;
io_tv.tv_usec = 0;