aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-12-07 09:09:37 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-12-07 09:09:37 +0000
commit3e61a8e490c96be55b12293c861bc05bff061c72 (patch)
treecb831afbbb53c0b8650054a712cbe7c2636076f8 /src
parent2df03ee50f6ca1415f2f0ba8d5cf87a93a3ed094 (diff)
downloadrspamd-3e61a8e490c96be55b12293c861bc05bff061c72.tar.gz
rspamd-3e61a8e490c96be55b12293c861bc05bff061c72.zip
[Minor] Fix task timeout in proxy worker
Diffstat (limited to 'src')
-rw-r--r--src/rspamd_proxy.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/rspamd_proxy.c b/src/rspamd_proxy.c
index 45af47cbb..aff866bb4 100644
--- a/src/rspamd_proxy.c
+++ b/src/rspamd_proxy.c
@@ -1748,16 +1748,14 @@ rspamd_proxy_self_scan (struct rspamd_proxy_session *session)
double_to_tv (session->ctx->default_upstream->timeout, &task_tv);
event_add (&task->timeout_ev, &task_tv);
}
-
- if (session->ctx->has_self_scan) {
- if (!isnan (session->ctx->cfg->task_timeout) &&
- session->ctx->cfg->task_timeout > 0) {
+ else if (session->ctx->has_self_scan) {
+ if (session->ctx->cfg->task_timeout > 0) {
struct timeval task_tv;
event_set (&task->timeout_ev, -1, EV_TIMEOUT, rspamd_task_timeout,
task);
event_base_set (session->ctx->ev_base, &task->timeout_ev);
- double_to_tv (session->ctx->default_upstream->timeout, &task_tv);
+ double_to_tv (session->ctx->cfg->task_timeout, &task_tv);
event_add (&task->timeout_ev, &task_tv);
}
}