summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-01-28 14:38:51 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-01-28 14:38:51 +0000
commitb70711c9e1be8c2387ba468dedb5776a8184ee9d (patch)
tree72fab01ec55a46a5ab4d4abdbe59a8396c3fff95 /src
parent21445a33871eb64b562defd4ab80ec53fca4b740 (diff)
downloadrspamd-b70711c9e1be8c2387ba468dedb5776a8184ee9d.tar.gz
rspamd-b70711c9e1be8c2387ba468dedb5776a8184ee9d.zip
[Minor] Slightly increase write timeout
Diffstat (limited to 'src')
-rw-r--r--src/libserver/task.c2
-rw-r--r--src/rspamd_proxy.c2
-rw-r--r--src/worker.c3
3 files changed, 4 insertions, 3 deletions
diff --git a/src/libserver/task.c b/src/libserver/task.c
index 096933803..43ce59ee1 100644
--- a/src/libserver/task.c
+++ b/src/libserver/task.c
@@ -125,7 +125,7 @@ rspamd_task_new (struct rspamd_worker *worker,
static void
rspamd_task_reply (struct rspamd_task *task)
{
- const ev_tstamp write_timeout = 2.0;
+ const ev_tstamp write_timeout = 5.0;
if (task->fin_callback) {
task->fin_callback (task, task->fin_arg);
diff --git a/src/rspamd_proxy.c b/src/rspamd_proxy.c
index 3fa5da390..f5bc5f68e 100644
--- a/src/rspamd_proxy.c
+++ b/src/rspamd_proxy.c
@@ -1737,7 +1737,7 @@ rspamd_proxy_scan_self_reply (struct rspamd_task *task)
NULL,
ctype,
session,
- 0);
+ session->ctx->timeout / 10.0);
}
}
diff --git a/src/worker.c b/src/worker.c
index 1a3b118c8..5262f7cde 100644
--- a/src/worker.c
+++ b/src/worker.c
@@ -271,12 +271,13 @@ rspamd_worker_error_handler (struct rspamd_http_connection *conn, GError *err)
rspamd_printf_fstring (&reply, "{\"error\":\"%V\"}", msg->status);
rspamd_http_message_set_body_from_fstring_steal (msg, reply);
rspamd_http_connection_reset (task->http_conn);
+ /* Use a shorter timeout for writing reply */
rspamd_http_connection_write_message (task->http_conn,
msg,
NULL,
"application/json",
task,
- 1.0);
+ session->ctx->timeout / 10.0);
}
}
else {