commit 3e61a8e: [Minor] Fix task timeout in proxy worker

Vsevolod Stakhov vsevolod at highsecure.ru
Thu Dec 27 18:28:04 UTC 2018


Author: Vsevolod Stakhov
Date: 2018-12-07 09:09:37 +0000
URL: https://github.com/rspamd/rspamd/commit/3e61a8e490c96be55b12293c861bc05bff061c72

[Minor] Fix task timeout in proxy worker

---
 src/rspamd_proxy.c | 8 +++-----
 1 file 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);
 		}
 	}


More information about the Commits mailing list