From: Vsevolod Stakhov Date: Thu, 18 Nov 2021 15:45:09 +0000 (+0000) Subject: [Fix] Do not double call error handler on ssl errors in the timeout path X-Git-Tag: 3.2~249 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8035236f55336a2220f8598719e8dad2f01e3e8b;p=rspamd.git [Fix] Do not double call error handler on ssl errors in the timeout path --- 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);