From 48779e829f8be7e94a45915a785c335977fb7ae9 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 9 Nov 2021 12:29:18 +0000 Subject: [PATCH] [Minor] Add potential workaround for the race condition --- src/libserver/ssl_util.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libserver/ssl_util.c b/src/libserver/ssl_util.c index 40214ed89..b4e905619 100644 --- a/src/libserver/ssl_util.c +++ b/src/libserver/ssl_util.c @@ -434,6 +434,13 @@ rspamd_ssl_connection_dtor (struct rspamd_ssl_connection *conn) g_free (conn->hostname); } + /* + * Try to workaround for the race between timeout and ssl error + */ + if (conn->shut_ev != conn->ev && ev_can_stop (&conn->ev->tm)) { + rspamd_ev_watcher_stop (conn->event_loop, conn->ev); + } + if (conn->shut_ev) { rspamd_ev_watcher_stop (conn->event_loop, conn->shut_ev); g_free (conn->shut_ev); -- 2.39.5