From: Vsevolod Stakhov Date: Tue, 9 Nov 2021 12:29:18 +0000 (+0000) Subject: [Minor] Add potential workaround for the race condition X-Git-Tag: 3.2~280 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=48779e829f8be7e94a45915a785c335977fb7ae9;p=thirdparty%2Frspamd.git [Minor] Add potential workaround for the race condition --- diff --git a/src/libserver/ssl_util.c b/src/libserver/ssl_util.c index 40214ed899..b4e905619d 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);