commit 48779e8: [Minor] Add potential workaround for the race condition

Vsevolod Stakhov vsevolod at highsecure.ru
Tue Nov 9 12:35:04 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-11-09 12:29:18 +0000
URL: https://github.com/rspamd/rspamd/commit/48779e829f8be7e94a45915a785c335977fb7ae9 (HEAD -> master)

[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);


More information about the Commits mailing list