From 8035236f55336a2220f8598719e8dad2f01e3e8b Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 18 Nov 2021 15:45:09 +0000 Subject: [PATCH] [Fix] Do not double call error handler on ssl errors in the timeout path --- src/libserver/http/http_connection.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/libserver/http/http_connection.c b/src/libserver/http/http_connection.c index a24fe6de6..e3e32eef8 100644 --- a/src/libserver/http/http_connection.c +++ b/src/libserver/http/http_connection.c @@ -1056,7 +1056,7 @@ rspamd_http_event_handler (int fd, short what, gpointer ud) } } else if (r == 0) { - if (!conn->finished) { + if (!conn->finished && !priv->ssl) { err = g_error_new (HTTP_ERROR, 408, "IO timeout"); conn->error_handler (conn, err); @@ -1069,10 +1069,12 @@ rspamd_http_event_handler (int fd, short what, gpointer ud) return; } else { - err = g_error_new (HTTP_ERROR, 408, - "IO timeout"); - conn->error_handler (conn, err); - g_error_free (err); + if (!priv->ssl) { + err = g_error_new(HTTP_ERROR, 408, + "IO timeout"); + conn->error_handler(conn, err); + g_error_free(err); + } REF_RELEASE (pbuf); rspamd_http_connection_unref (conn); -- 2.39.5