From 41278986553ce31c20fd6c5c66d08c192d3e8476 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Fri, 27 Dec 2024 14:27:52 -0500 Subject: [PATCH] ssb: Avoid more work on shutdown. --- src/ssb.rpc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ssb.rpc.c b/src/ssb.rpc.c index dd1a91ed..a3a56d74 100644 --- a/src/ssb.rpc.c +++ b/src/ssb.rpc.c @@ -859,7 +859,7 @@ static void _tf_ssb_connection_send_history_stream_after_work(tf_ssb_connection_ { tf_ssb_connection_send_history_stream_t* request = user_data; tf_ssb_connection_adjust_write_count(connection, -1); - if (tf_ssb_connection_is_connected(connection)) + if (tf_ssb_connection_is_connected(connection) && !tf_ssb_is_shutting_down(tf_ssb_connection_get_ssb(connection))) { for (int i = 0; i < request->out_messages_count; i++) { @@ -890,7 +890,7 @@ static void _tf_ssb_connection_send_history_stream_after_work(tf_ssb_connection_ static void _tf_ssb_connection_send_history_stream_callback(tf_ssb_connection_t* connection, void* user_data) { tf_ssb_connection_adjust_write_count(connection, 1); - if (tf_ssb_connection_is_connected(connection)) + if (tf_ssb_connection_is_connected(connection) && !tf_ssb_is_shutting_down(tf_ssb_connection_get_ssb(connection))) { tf_ssb_connection_run_work(connection, _tf_ssb_connection_send_history_stream_work, _tf_ssb_connection_send_history_stream_after_work, user_data); }