]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Add potential workaround for the race condition
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 9 Nov 2021 12:29:18 +0000 (12:29 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 9 Nov 2021 12:29:18 +0000 (12:29 +0000)
src/libserver/ssl_util.c

index 40214ed899e28c4cbc2c5457a3b5b7cdf298d028..b4e905619dab161925f08ee48d0d200c5a2af47f 100644 (file)
@@ -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);