From 639fce376af9455edd723e3db4363eb73128bcaa Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Thu, 2 Jan 2025 13:01:09 -0500 Subject: [PATCH] ssb: More uv_async_send paranoia still. #96 --- src/ssb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ssb.c b/src/ssb.c index 206cdfa7..2d892752 100644 --- a/src/ssb.c +++ b/src/ssb.c @@ -2719,7 +2719,8 @@ static void _tf_ssb_connection_finalizer(JSRuntime* runtime, JSValue value) static void _tf_ssb_connection_process_message_async(uv_async_t* async) { tf_ssb_connection_t* connection = async->data; - if (!connection->is_closing && _tf_ssb_connection_box_stream_recv(connection)) + /* The receive may initiate a close, so this order is important. */ + if (_tf_ssb_connection_box_stream_recv(connection) && !connection->is_closing) { uv_async_send(&connection->async); }